----- Original Message -----
From: "Ray Olszewski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 01, 2000 11:29 AM
Subject: Re: keepalive/wakeup script


> A few observations.
>
> First, the ping line in Jack's script surely should read:
>
>         system ("ping -c 1 $host");

Forgot about that, should of read my script before I posted.  Yea don't do
what my orignal post said, it will 1) eat up most if not all your bandwidth
2) probably get your kicked off your isp for an admitted dos attack

>
> so it sends only one ping packet instead of an unending stream of them.
>
> Second, perl has "sleep" built in, so that line *can* read
>
>         sleep $sleep"  ; }

Yea that works and probably be faster sleep :)

> (though the way Jack wrote it does work).
>
> Third, if the program is run in the background (./alive &), won't the
> "print" line block and stop the program from continuing to execute until
it
> is re-attached to a console?

Yea, I ussually put it on tty6 with a background seti process, that way I
can flip over and check it.  Also you can redirect the output the file and
if you connection dies you can check up on about what time the connection
died (though the date command (you can also use localtime()), this does take
up a lot of disk space though, so watch it.

It would be easy to say if ping failed to record the time when it failed and
nothing else, but I was just going in to a quick example here.

>
> At 11:08 AM 8/1/00 -0500, Jack Barnett wrote:
> ...
> >Also a quick perl script works, I have one on my system that looks
something
> >like this (IIRC):
> >
> >
> >#!/usr/bin/perl -w
> >
> >$sleep = "180"; $host = "myisp.net";
> >while (1 == 1)
> > { system ("date");
> >    system ("ping $host");
> >    print ("Staying Alive, Staying Alive, o o o yea, Stayiiiiiiiing
> >Alliveeeeee\n");
> >    system ("sleep $sleep"); }
> >
> >Then run it with something like
> >
> >./alive &
>
> --
> ------------------------------------"Never tell me the odds!"---
> Ray Olszewski                                        -- Han Solo
> Palo Alto, CA                    [EMAIL PROTECTED]
> ----------------------------------------------------------------
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to [EMAIL PROTECTED]
> Please read the FAQ at http://www.linux-learn.org/faqs
>


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to