From 965059d45c2fec0b949aa617de54603e0551233b Mon Sep 17 00:00:00 2001 From: xq2005 Date: Thu, 11 Jul 2013 05:04:19 +0000 Subject: [PATCH] bug 3684, configeth on ubuntu/debian need File::Path git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16937 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/configeth | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index bb6cfc0c4..06d76bb62 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -109,6 +109,13 @@ if ($rm_nics) { `mv $dir/ifcfg-$nics_rm[$i] $dir/ifcfg-$nics_rm[$i].old >/dev/null 2>&1`; } + elsif ( -f "/etc/debian_version" ){ + runcmd("ifdown --force $nics_rm[$i]"); + if ( -e "/etc/network/interfaces.d/$nics_rm[$i]" ){ + runcmd("rm -f /etc/network/interfaces.d/${nics_rm[$i]}"); + runcmd("rm -f /etc/network/interfaces.d/${nics_rm[$i]}:*"); + } + } else { # OS is redhat. # Note that the ifdown command will fail if the configuration file does not exist @@ -568,10 +575,10 @@ for ($j=0; $j < (scalar @nics_to_install); $j++) { if ($ret) { my $num_oldnums = scalar(keys %hash_oldips); #need delete the ip address or first time configure - if (($num_oldnums > 0) || ($bool_config_flag == 0) ){ - `ifdown $nic;ifup $nic`; + if ( -f "/etc/debian_version"){ + `ifdown --forece $nic;ifup $nic`; } - elsif ( -f "/etc/debian_version"){ + elsif (($num_oldnums > 0) || ($bool_config_flag == 0) ){ `ifdown $nic;ifup $nic`; } else {