perlquestion
JP Sama
I use ADSL connection, and my connection has an "unexplicable" problem!<br>
So I've decided to use a pl in my cron... :) but, I am wandering if the best way to do it is using:<br>
(for example)<br>
<code>
#!/usr/bin/perl
@ips = ('200.219.199.32','204.71.200.75');
foreach $ip (@ips) {
$ping = system("ping -c 1 $ip");
if ($ping < 256) { #
next;
} elsif ($ping = 256) { # timed out
# do something to restart the connection
# probably, set internal modem (not my Adsl modem)to pick up the phone line, and hangup, to cause a "sync break"!
}
}
</code>
If someone could give me a "light", or a sugestion about the best way to do it!<br><br>
tks to all!<br>
<br>
-jpsama