Merge pull request #2145 from onlyjob/arp_regex

fix regex to match IP and first numbers of MAC in the `arp -a` output (Closes: #2144)
This commit is contained in:
Andrew Bauer 2018-07-07 08:24:47 -05:00 committed by GitHub
commit f5dce7e863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,7 @@ if ( $status )
Fatal( "Unable to probe network cameras, status is '$status'" ); Fatal( "Unable to probe network cameras, status is '$status'" );
foreach ( $output as $line ) foreach ( $output as $line )
{ {
if ( !preg_match( '/^.*([\d.]+).*([0-9a-f:]+).*/', $line, $matches ) ) if ( !preg_match( '/(\d+\.\d+\.\d+\.\d+).*(([0-9a-f]{2}:){5})/', $line, $matches ) )
continue; continue;
$ip = $matches[1]; $ip = $matches[1];
$host = $ip; $host = $ip;