

| The Following 11 Users Say Thank You to briggers For This Useful Post: | ||
| The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
| The Following User Says Thank You to slaapliedje For This Useful Post: | ||
#!/usr/bin/perl -w
use LWP::UserAgent;
my $l_hostname = shift @ARGV or die "Pass an IP or hostname, ya muppet\n";
my $l_port = shift @ARGV || 80;
my $l_timeout =shift @ARGV || 5;
my $ua = LWP::UserAgent->new;
$ua->timeout($l_timeout);
my $response = $ua->get('http://' . $l_hostname . ':' . $l_port . '/');
exit 0 if $response->is_success;
# No response ...
exit 1;
gregor@sauzee:~$ if $(./checkService.pl eck.local 22) ; then echo "alive" ; fi alive gregor@sauzee:~$
gregor@sauzee:~$ if ! $(./checkService.pl eck.local 23) ; then echo "FTP is pure deid man" ; fi FTP is pure deid man gregor@sauzee:~$
| The Following 5 Users Say Thank You to gregoranderson For This Useful Post: | ||
| The Following 2 Users Say Thank You to briggers For This Useful Post: | ||
| The Following User Says Thank You to briggers For This Useful Post: | ||