diff --git a/xCAT/postscripts/confighfi b/xCAT/postscripts/confighfi index 5ea5cdd93..87d0c447f 100644 --- a/xCAT/postscripts/confighfi +++ b/xCAT/postscripts/confighfi @@ -105,13 +105,13 @@ ONBOOT=yes 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 " + XCATMASTER=`grep "$MASTER " /etc/hosts | grep -v "^#" | awk '{print $2}' | awk -F '.' '{print $1}' | sed 's/-hf.*//g'` + GATEWAY_IP=`ping -c 3 $XCATMASTER-bond0 -I hf0 2>/dev/null | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' | uniq 2>&1` 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 " + GATEWAY_IP=`ping -c 3 $XCATMASTER-bond0 -I hf0 2>/dev/null | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' | uniq 2>&1` fi if [ -n "$GATEWAY_IP" ]