Determine full path to arp

This commit is contained in:
Andrew Bauer 2014-07-05 11:11:36 -05:00
parent c2e2a12995
commit 48d961082c
2 changed files with 18 additions and 2 deletions

View File

@ -287,7 +287,15 @@ $macBases = array(
);
unset($output);
$command = "arp -a";
// Calling arp without the full path was reported to fail on some systems
// Use the builtin unix command "type" to tell us where the command is
$command = "type -p arp";
$result = exec( escapeshellcmd($command), $output, $status );
if ( $status )
Fatal( "Unable determine arp path, status is '$status'" );
// Now that we know where arp is, call it using the full path
$command = $output[0]." -a";
unset($output);
$result = exec( escapeshellcmd($command), $output, $status );
if ( $status )
Fatal( "Unable to probe network cameras, status is '$status'" );

View File

@ -287,7 +287,15 @@ $macBases = array(
);
unset($output);
$command = "arp -a";
// Calling arp without the full path was reported to fail on some systems
// Use the builtin unix command "type" to tell us where the command is
$command = "type -p arp";
$result = exec( escapeshellcmd($command), $output, $status );
if ( $status )
Fatal( "Unable determine arp path, status is '$status'" );
// Now that we know where arp is, call it using the full path
$command = $output[0]." -a";
unset($output);
$result = exec( escapeshellcmd($command), $output, $status );
if ( $status )
Fatal( "Unable to probe network cameras, status is '$status'" );