diff --git a/xCAT/postscripts/confighfi b/xCAT/postscripts/confighfi index 742d30caf..5ea5cdd93 100644 --- a/xCAT/postscripts/confighfi +++ b/xCAT/postscripts/confighfi @@ -101,6 +101,26 @@ ONBOOT=yes " >/etc/sysconfig/network-scripts/ifcfg-bond0 fi + if [[ $NTYPE != service ]] + then + if echo $MASTER | egrep '^([0-9]+.){3}[0-9]+$' + then + XCATMASTER=`grep "$MASTER " /etc/hosts | grep -v "^#" | awk '{print + GATEWAY_IP=`ping -c 3 $XCATMASTER-bond0 -I hf0 2>/dev/null | grep " + + elif [ -n "$MASTER" ] + then + XCATMASTER=`echo $MASTER | awk -F-hf '{print $1}'` + GATEWAY_IP=`ping -c 3 $XCATMASTER-bond0 -I hf0 2>/dev/null | grep " + fi + + if [ -n "$GATEWAY_IP" ] + then + sed -i "/GATEWAY.*/d" /etc/sysconfig/network + echo "GATEWAY=$GATEWAY_IP" >> /etc/sysconfig/network + fi + fi + x=0 while [ $x -le $i ]; do ip link set dev hf${x} down