fix bugs in enablekdump postscript

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12015 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2012-03-27 02:58:24 +00:00
parent cb9f6e46ec
commit 7421eba5ba

View File

@ -22,7 +22,7 @@ for i in `/bin/cat /proc/cmdline`; do
break
elif [ "$KEY" = "netdev" ]; then
ETHX=`/bin/echo $i | /bin/awk -F= '{print $2}'`
MACX=`/sbin/ip link show $netdev | /bin/grep ether | /bin/awk '{print $2}'`
MACX=`/sbin/ip link show $ETHX | /bin/grep ether | /bin/awk '{print $2}'`
break
elif [ "$KEY" = "BOOTIF" ]; then
MACX=`/bin/echo $i | /bin/awk -F= '{print $2}'`
@ -32,13 +32,19 @@ for i in `/bin/cat /proc/cmdline`; do
done
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
if [ ! -e $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then
/bin/touch $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX
if (pmatch $OSVER "sles*") || (pmatch $OSVER "suse*") || [ -f /etc/SuSE-release ]; then
CONFFILE=$MNTDIR/etc/sysconfig/network/ifcfg-$ETHX
fi
if (pmatch $OSVER "fedora*") || (pmatch $OSVER "rhel6*") || (pmatch $OSVER "rhels6*") || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ];then
CONFFILE=$MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX
fi
if [ ! -e $CONFFILE ]; then
/bin/touch $CONFFILE
fi
echo "DEVICE=$ETHX" > $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX
echo "BOOTPROTO=dhcp" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX
echo "HWADDR=$MACX" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX
echo "ONBOOT=yes" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX
echo "DEVICE=$ETHX" > $CONFFILE
echo "BOOTPROTO=dhcp" >> $CONFFILE
echo "HWADDR=$MACX" >> $CONFFILE
echo "ONBOOT=yes" >> $CONFFILE
fi