]> git.etc.gen.nz Git - spong.git/commitdiff
added 'eval use Net::Ping' to module, removed from main program
authorStephen L Johnson <sjohnson@monsters.org>
Mon, 17 Apr 2000 18:59:55 +0000 (18:59 +0000)
committerStephen L Johnson <sjohnson@monsters.org>
Mon, 17 Apr 2000 18:59:55 +0000 (18:59 +0000)
src/lib/Spong/Network/plugins/check_ping

index 66cb749bcd60ceaeeaf3d481d0786e1c4180ac32..adedba350e0dc22c5e94854198e6fd280560c3ef 100755 (executable)
@@ -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