copy from 2.8 for supporting kdump on p7 ih by static ip

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12939 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2012-05-25 07:17:26 +00:00
parent bbbd6f0133
commit 6d4ec668cb

View File

@ -41,10 +41,21 @@ if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
if [ ! -e $CONFFILE ]; then
/bin/touch $CONFFILE
fi
echo "DEVICE=$ETHX" > $CONFFILE
echo "BOOTPROTO=dhcp" >> $CONFFILE
echo "HWADDR=$MACX" >> $CONFFILE
echo "ONBOOT=yes" >> $CONFFILE
if (pmatch $ETHX "hf*") ; then
IP=`/sbin/ifconfig $ETHX | /bin/grep -i "inet addr" | awk '{print $2}' | awk -F: '{print $2}'`
MASK=`/sbin/ifconfig $ETHX | /bin/grep -i "inet addr" | awk '{print $4}' | awk -F: '{print $2}'`
echo "DEVICE=$ETHX" > $CONFFILE
echo "BOOTPROTO=static" >> $CONFFILE
echo "HWADDR=$MACX" >> $CONFFILE
echo "ONBOOT=yes" >> $CONFFILE
echo "IPADDR=$IP" >> $CONFFILE
echo "NETMASK=$MASK" >> $CONFFILE
else
echo "DEVICE=$ETHX" > $CONFFILE
echo "BOOTPROTO=dhcp" >> $CONFFILE
echo "HWADDR=$MACX" >> $CONFFILE
echo "ONBOOT=yes" >> $CONFFILE
fi
fi