fix bugs in install.sh

Change-Id: I9461be7ee99c81d9691a216ecd00f6d432ef54ec
This commit is contained in:
Xicheng Chang 2016-08-25 19:54:18 -04:00
parent af4c49294c
commit 2b2ecce938

View File

@ -200,12 +200,12 @@ fi
# Install figlet # Install figlet
sudo yum -y install figlet >& /dev/null sudo yum -y install figlet >& /dev/null
if [[ "$?" != "0" ]]; then # if [[ "$?" != "0" ]]; then
echo "failed to install figlet" # echo "failed to install figlet"
exit 1 # exit 1
else # else
echo "figlet is installed" # echo "figlet is installed"
fi # fi
figlet -ctf slant Compass Installer figlet -ctf slant Compass Installer
while [ $1 ]; do while [ $1 ]; do
@ -270,7 +270,7 @@ fi
export NIC=${NIC:-"eth1"} export NIC=${NIC:-"eth1"}
export IPADDR=${IPADDR:-$(sudo ifconfig ${NIC} | awk '($1=="inet"){print $2}')} export IPADDR=${IPADDR:-$(sudo ifconfig ${NIC} | awk '($1=="inet"){print $2}')}
export IPADDR=${IPADDR:-"10.1.0.15"} export IPADDR=${IPADDR:-"10.1.0.15"}
export NETMASK=${NETMASK:-$(sudo ifconfig ${NIC} | awk '($3="netmask"){print $4}')} export NETMASK=${NETMASK:-$(sudo ifconfig ${NIC} | awk '($3=="netmask"){print $4}')}
export NETMASK=${NETMASK:-"255.255.255.0"} export NETMASK=${NETMASK:-"255.255.255.0"}
sudo ifconfig ${NIC} ${IPADDR} netmask ${NETMASK} up sudo ifconfig ${NIC} ${IPADDR} netmask ${NETMASK} up