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 2c8cb58058
commit cdac8c65a1

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)
{