blob: 697520cbae20b7d97c753b9f29bbc509a47db6d0 [file] [log] [blame]
Sergio Slobodrianc5477712017-06-07 11:56:56 -04001#!/bin/bash
Zack Williams41513bf2018-07-07 20:08:35 -07002# 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 Slobodrianc5477712017-06-07 11:56:56 -040015
16baseImage="Ubuntu1604LTS"
17iVmName="vInstaller"
18iVmNetwork="default"
19shutdownTimeout=5
20ipTimeout=10
21installerArchive="installer.tar.bz2"
22installerPart="installer.part"
23
24lBlue='\033[1;34m'
25green='\033[0;32m'
26orange='\033[0;33m'
27NC='\033[0m'
28red='\033[0;31m'
29yellow='\033[1;33m'
30dGrey='\033[1;30m'
31lGrey='\033[1;37m'
32lCyan='\033[1;36m'
33
34wd=`pwd`
35
36# Check if the tar file is available.
37echo -e "${lBlue}Checking for the installer archive ${lCyan}$installerArchive${NC}"
38
39if [ ! -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
52fi
53
54# Extract the installer files and bootstrap the installer
55echo -e "${lBlue}Extracting the content of the installer archive ${lCyan}$installerArchive${NC}"
56tar xjf $installerArchive
Sergio Slobodrian263900e2017-06-16 21:39:04 -040057echo -e "${lBlue}Starting the installer${NC}"
Sergio Slobodrianc5477712017-06-07 11:56:56 -040058chmod u+x BootstrapInstaller.sh
Sergio Slobodrian7c483622017-06-13 15:51:34 -040059./BootstrapInstaller.sh "$@"