Fixed SF bug #3159 rcons can not work when node.conserver is set to MN

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15341 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2013-03-01 15:29:42 +00:00
parent 372a951dee
commit dfd9d9a7a8

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
# Provide serial console access to nodes
@ -105,6 +105,24 @@ else
echo "Error: nodehm.mgt or nodehm.cons for node $1 not setup."
exit 1;
fi
#check if conserver is local host
result=`ping -c1 $CONSERVER 2>&1`
if [ $? -eq 0 ]; then
index1=`expr index "$result" "\("`
index2=`expr index "$result" "\)"`
pos=`expr $index1 + 1`
length=`expr $index2 - $index1`
length=`expr $length - 1`
cons_ip=`expr substr "$result" $pos $length`
ifconfig |grep "$cons_ip"
if [ $? -eq 0 ]; then
CONSERVER=""
fi
else
echo "Error: conserver $CONSERVER is not reachable."
exit 1;
fi
#echo "CONS=$CONS CONSERVER=$CONSERVER"
# check if others are using the console