From 7926409a79f1d66fc17e599ee5972322a2143fbd Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 15 Feb 2011 06:15:02 +0000 Subject: [PATCH] update hfi configuration postscript to match different client node convention git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8851 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/confighfi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/confighfi b/xCAT/postscripts/confighfi index c404ee35b..8e4403a0b 100644 --- a/xCAT/postscripts/confighfi +++ b/xCAT/postscripts/confighfi @@ -1,9 +1,19 @@ #!/bin/sh +name=`echo $NODE | awk -F- '{print $1}'` +if [ -z $name ] +then +name=$NODE +fi + for ((i=0;i<4;i++)) do -CLIENT_IP=`ping -c 3 $NODE-hf$i | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' || - uniq 2>&1` +if [ $i = 0 ] +then +CLIENT_IP=`ping -c 3 $NODE | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' | uniq 2>&1` +else +CLIENT_IP=`ping -c 3 $name-hf$i | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' | uniq 2>&1` +fi if [ -n $CLIENT_IP ] then @@ -15,7 +25,7 @@ ONBOOT=yes " >/etc/sysconfig/network-scripts/ifcfg-hf$i ifup hf$i - sleep 1 fi + done