handle when conserver is management node itslef.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15262 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
d49c882778
commit
56684fb6da
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user