Menu

#15 functions-network.php patch for OpenBSD ping binary

Unstable_(example)
closed
nobody
None
1
2015-02-04
2014-09-27
No

Tests fine on OpenBSD 5.5, and -current using phpipam-1.0.
OpenBSD ping(8) man pages suggest this change is compatible back to OpenBSD 2.2

--- functions-network.php.orig  Fri Sep 26 23:57:57 2014
+++ functions-network.php       Sat Sep 27 00:05:41 2014
@@ -2906,8 +2906,8 @@
        }
        else {
                //set ping command based on OS type
-               if(PHP_OS == "FreeBSD" || PHP_OS == "NetBSD" || PHP_OS == "OpenBSD")    { $cmd = "$pathPing -c $count -W ".($timeout*1000)." $ip 1>/dev/null 2>&1"; }
-               elseif(PHP_OS == "Linux")                                                                                               { $cmd = "$pathPing -c $count -w $timeout
 $ip 1>/dev/null 2>&1"; }
+               if(PHP_OS == "FreeBSD" || PHP_OS == "NetBSD")                           { $cmd = "$pathPing -c $count -W ".($timeout*1000)." $ip 1>/dev/null 2>&1"; }
+               elseif(PHP_OS == "Linux" || PHP_OS == "OpenBSD")                        { $cmd = "$pathPing -c $count -w $timeout $ip 1>/dev/null 2>&1"; }
                elseif(PHP_OS == "WIN32" || PHP_OS == "Windows" || PHP_OS == "WINNT")   { $cmd = "$pathPing -n $count -I ".($timeout*1000)." $ip 1>/dev/null 2>&1"; }
                else                                                                                                                                    { $cmd = "$pathPing -c $count -n $ip 1>/dev/null 2>&1"; }

Discussion

  • Emille Blanc

    Emille Blanc - 2014-09-27

    Forgot to attach the patch. :]

     

    Last edit: Emille Blanc 2014-09-27
  • Miha Petkovsek

    Miha Petkovsek - 2014-11-17

    Thanks, will fix for next release.

     
  • Miha Petkovsek

    Miha Petkovsek - 2014-11-17
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel