fix for bug 4239: do not use ip command on AIX

This commit is contained in:
ligc 2013-07-31 16:23:43 +08:00
parent a10fe3f1d6
commit 5d547f0985

12
perl-xCAT/xCAT/InstUtils.pm Normal file → Executable file
View File

@ -217,7 +217,17 @@ sub is_me
#my ($b1, $b2, $b3, $b4) = split /\./, $nameIP;
# get all the possible IPs for the node I'm running on
my $ipcmd = "ip addr | grep 'inet'";
# this is a common subroutine for both AIX and Linux,
# AIX does not have ip command
my $ipcmd;
if ( -f "/sbin/ip" )
{
$ipcmd = "ip addr | grep 'inet'";
}
else
{
$ipcmd = "ifconfig -a | grep 'inet'";
}
my $result = xCAT::Utils->runcmd($ipcmd, -1, 1);
if ($::RUNCMD_RC != 0)
{