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
This commit is contained in:
wanghuaz 2011-02-15 06:15:02 +00:00
parent e518c01e32
commit 7926409a79

View File

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