7926409a79
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8851 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
32 lines
501 B
Bash
32 lines
501 B
Bash
#!/bin/sh
|
|
|
|
name=`echo $NODE | awk -F- '{print $1}'`
|
|
if [ -z $name ]
|
|
then
|
|
name=$NODE
|
|
fi
|
|
|
|
for ((i=0;i<4;i++))
|
|
do
|
|
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
|
|
echo "DEVICE=hf$i
|
|
NM_CONTROLLED=yes
|
|
IPADDR=$CLIENT_IP
|
|
NETMASK=255.0.0.0
|
|
ONBOOT=yes
|
|
" >/etc/sysconfig/network-scripts/ifcfg-hf$i
|
|
|
|
ifup hf$i
|
|
sleep 1
|
|
fi
|
|
|
|
done
|