diff --git a/install/install.conf.template b/install/install.conf.template index 6f593225..acbd265f 100755 --- a/install/install.conf.template +++ b/install/install.conf.template @@ -26,8 +26,8 @@ export SUPPORT_UBUNTU_14_04_03=${SUPPORT_UBUNTU_14_04_03:-"y"} # DHCP config export IPADDR=`ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` # export IPADDR=`ip addr show $NIC | grep "inet " | sed 's/^[ \t]*//g' | cut -d' ' -f 2 | cut -d'/' -f 1` -# export NETMASK=$(ifconfig $NIC |grep Mask | cut -f 4 -d ':') -export NETMASK=$(ipcalc `ip addr show $NIC | grep "inet " | sed 's/^[ \t]*//g' | cut -d' ' -f 2` -m | grep NETMASK | cut -d '=' -f 2) +export NETMASK=$(ifconfig $NIC |grep Mask | cut -f 4 -d ':') +# export NETMASK=$(ipcalc `ip addr show $NIC | grep "inet " | sed 's/^[ \t]*//g' | cut -d' ' -f 2` -m | grep NETMASK | cut -d '=' -f 2) # DHCP option router address(Default is your management interface IP address )" # export OPTION_ROUTER=`ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` export OPTION_ROUTER=$IPADDR diff --git a/install/install.sh b/install/install.sh index 6fc8fe60..c04e6597 100755 --- a/install/install.sh +++ b/install/install.sh @@ -177,15 +177,15 @@ if [ $? -ne 0 ]; then exit 1 fi -# export ipaddr=$(ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') -export ipaddr=$(ifconfig $NIC | grep 'inet ' | cut -d' ' -f10) +export ipaddr=$(ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') +# export ipaddr=$(ifconfig $NIC | grep 'inet ' | cut -d' ' -f10) loadvars IPADDR ${ipaddr} ipcalc $IPADDR -c if [ $? -ne 0 ]; then echo "ip addr $IPADDR format should be x.x.x.x" exit 1 fi -export netmask=$(ifconfig $NIC | grep netmask | cut -d ' ' -f 13) +export netmask=$(ifconfig $NIC | grep Mask | cut -d: -f4) loadvars NETMASK ${netmask} export netaddr=$(ipcalc $IPADDR $NETMASK -n |cut -f 2 -d '=') export netprefix=$(ipcalc $IPADDR $NETMASK -p |cut -f 2 -d '=')