Router Test

Sometimes it is handy to check to see if you’ve got connectivity through an ethernet interface, especially a wireless one.  This Perl program does a ping to see if the router answers and tells HCA the results.

use Net::Ping;
my $p = Net::Ping->new;
my $outfile = “perl-flags.txt”;
my $outline = “”;
open OUTPUT, “> $outfile” or die “Output file open error: $!”;

if ($p->ping(“”)){
$outline = “router2conn=yes”
$outline = “router2conn=no”
print OUTPUT $outline;
close OUTPUT;

As In Various and Sundry