From 721d75f8afefd354b5e12e0a90067a015e080988 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Mon, 17 Apr 2000 18:59:55 +0000 Subject: [PATCH] added 'eval use Net::Ping' to module, removed from main program --- src/lib/Spong/Network/plugins/check_ping | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.30.2