Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 15 | |
| 16 | baseImage="Ubuntu1604LTS" |
| 17 | iVmName="vInstaller" |
| 18 | iVmNetwork="default" |
| 19 | shutdownTimeout=5 |
| 20 | ipTimeout=10 |
| 21 | installerArchive="installer.tar.bz2" |
| 22 | installerPart="installer.part" |
| 23 | |
| 24 | lBlue='\033[1;34m' |
| 25 | green='\033[0;32m' |
| 26 | orange='\033[0;33m' |
| 27 | NC='\033[0m' |
| 28 | red='\033[0;31m' |
| 29 | yellow='\033[1;33m' |
| 30 | dGrey='\033[1;30m' |
| 31 | lGrey='\033[1;37m' |
| 32 | lCyan='\033[1;36m' |
| 33 | |
| 34 | wd=`pwd` |
| 35 | |
| 36 | # Check if the tar file is available. |
| 37 | echo -e "${lBlue}Checking for the installer archive ${lCyan}$installerArchive${NC}" |
| 38 | |
| 39 | if [ ! -f $installerArchive ]; then |
| 40 | # The installer file ins't there, check for parts to re-assemble |
| 41 | echo -e "${lBlue}Checking for the installer archive parts ${lCyan}$installerPart*${NC}" |
| 42 | fList=`ls ${installerPart}*` |
| 43 | if [ -z "$fList" ]; then |
| 44 | echo -e "${red} Could not find installer archive or installer archive parts, ABORTING.${NC}" |
| 45 | exit |
| 46 | else |
| 47 | # All is well, concatenate the files together to create the installer archive |
| 48 | echo -e "${lBlue}Creating the installer archive ${lCyan}$installerArchive${NC}" |
| 49 | cat $fList > installer.tar.bz2 |
| 50 | rm -fr $fList |
| 51 | fi |
| 52 | fi |
| 53 | |
| 54 | # Extract the installer files and bootstrap the installer |
| 55 | echo -e "${lBlue}Extracting the content of the installer archive ${lCyan}$installerArchive${NC}" |
| 56 | tar xjf $installerArchive |
Sergio Slobodrian | 263900e | 2017-06-16 21:39:04 -0400 | [diff] [blame] | 57 | echo -e "${lBlue}Starting the installer${NC}" |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 58 | chmod u+x BootstrapInstaller.sh |
Sergio Slobodrian | 7c48362 | 2017-06-13 15:51:34 -0400 | [diff] [blame] | 59 | ./BootstrapInstaller.sh "$@" |