From 340c5fc5531941446b680aade1520a02f481c9f2 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Thu, 6 Nov 2014 21:27:43 -0500 Subject: [PATCH] fix duplicate lines for IPADDR and NETMASK --- xCAT/postscripts/hardeths | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index caa0b63cb..43ec7c84e 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -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.