fix duplicate lines for IPADDR and NETMASK

This commit is contained in:
baiyuan 2014-11-06 21:27:43 -05:00
parent 0215a5bed2
commit 340c5fc553

View File

@ -114,8 +114,18 @@ EOF
sed -i s/BOOTPROTO=dhcp/BOOTPROTO=static/ $NICFILE
sed -i s/BOOTPROTO=\'dhcp\'/BOOTPROTO=static/ $NICFILE
sed -i s/BOOTPROTO=\"dhcp\"/BOOTPROTO=static/ $NICFILE
grep ^IPADDR= $NICFILE >/dev/null
if [ $? -eq 0 ]
then
sed -i '/IPADDR=/d' $NICFILE
fi
echo IPADDR=$IPADDR >> $NICFILE
echo NETMASK=$NETMASK >> $NICFILE
grep ^NETMASK= $NICFILE >/dev/null
if [ $? -eq 0 ]
then
sed -i '/NETMASK=/d' $NICFILE
fi
echo NETMASK=$NETMASK >> $NICFILE
fi
#for netboot/statelite case, restart the network interface. For diskful installation, it is not necessary because the restart of the network will happen at the first boot.