From: Stephen L Johnson Date: Mon, 17 Apr 2000 18:59:55 +0000 (+0000) Subject: added 'eval use Net::Ping' to module, removed from main program X-Git-Tag: spong-2_7-alpha5~12 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=721d75f8afefd354b5e12e0a90067a015e080988;p=spong.git added 'eval use Net::Ping' to module, removed from main program --- diff --git a/src/lib/Spong/Network/plugins/check_ping b/src/lib/Spong/Network/plugins/check_ping index 66cb749..adedba3 100755 --- a/src/lib/Spong/Network/plugins/check_ping +++ b/src/lib/Spong/Network/plugins/check_ping @@ -1,6 +1,12 @@ # Register the function the plugin registry $PLUGINS{'ping'} = \&check_ping; + +# Check to see if the Net::Ping module is installed + +eval "use Net::Ping;"; +if( ! $@ ) { $ping = 1; } else { $ping = 0; } + # This routine checks connectivity. It first trys to "ping" the machine via # a TCP echo using the Net::Ping module, if it can't reach it via that # mechanism, then it resorts to the command line ping program. Using the