Fix -g being specified even without a gateway

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12930 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-05-24 20:35:03 +00:00
parent 98c1a84cb5
commit 4589f5a558

View File

@ -203,7 +203,9 @@ sub setupIMM {
$ssh->cmd("ifconfig eth0 -ipv6static enable -i6 $ip");
} else {
(my $sip,my $mask,my $gw) = xCAT_plugin::bmcconfig::net_parms($ip);
$ssh->cmd("ifconfig eth0 -c static -i $ip -s $mask -g $gw");
my $cmd = "ifconfig eth0 -c static -i $ip -s $mask";
if ($gw) { $cmd .= "-g $gw"; }
$ssh->cmd($cmd);
}
}
$ssh->close();