Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | baseImage="Ubuntu1604LTS" |
| 4 | iVmName="vInstaller" |
| 5 | iVmNetwork="default" |
| 6 | shutdownTimeout=5 |
| 7 | ipTimeout=10 |
| 8 | installerArchive="installer.tar.bz2" |
| 9 | installerPart="installer.part" |
| 10 | |
| 11 | lBlue='\033[1;34m' |
| 12 | green='\033[0;32m' |
| 13 | orange='\033[0;33m' |
| 14 | NC='\033[0m' |
| 15 | red='\033[0;31m' |
| 16 | yellow='\033[1;33m' |
| 17 | dGrey='\033[1;30m' |
| 18 | lGrey='\033[1;37m' |
| 19 | lCyan='\033[1;36m' |
| 20 | |
| 21 | wd=`pwd` |
| 22 | |
| 23 | # Check if the tar file is available. |
| 24 | echo -e "${lBlue}Checking for the installer archive ${lCyan}$installerArchive${NC}" |
| 25 | |
| 26 | if [ ! -f $installerArchive ]; then |
| 27 | # The installer file ins't there, check for parts to re-assemble |
| 28 | echo -e "${lBlue}Checking for the installer archive parts ${lCyan}$installerPart*${NC}" |
| 29 | fList=`ls ${installerPart}*` |
| 30 | if [ -z "$fList" ]; then |
| 31 | echo -e "${red} Could not find installer archive or installer archive parts, ABORTING.${NC}" |
| 32 | exit |
| 33 | else |
| 34 | # All is well, concatenate the files together to create the installer archive |
| 35 | echo -e "${lBlue}Creating the installer archive ${lCyan}$installerArchive${NC}" |
| 36 | cat $fList > installer.tar.bz2 |
| 37 | rm -fr $fList |
| 38 | fi |
| 39 | fi |
| 40 | |
| 41 | # Extract the installer files and bootstrap the installer |
| 42 | echo -e "${lBlue}Extracting the content of the installer archive ${lCyan}$installerArchive${NC}" |
| 43 | tar xjf $installerArchive |
| 44 | echo -e "${lBlue}Starting the installer{NC}" |
| 45 | chmod u+x BootstrapInstaller.sh |
| 46 | ./BootstrapInstaller.sh |