make regtest work

Change-Id: I5ef324efc1e50e28635b0cbf92dd0f6e425cb322
This commit is contained in:
xiaodongwang991481 2016-01-09 22:53:43 -08:00
parent 7b741227ba
commit ae756692d0
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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 '=')