[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Taking down PPP at a certain hour of the day



On Mon, 23 Dec 1996, Matthew Stone wrote:

> I am wondering.. how I can do this.. I would like to create a script that
> run in the background and check the time.. if it is 8am it do a
> wall announcement saying the system is going down, kill all the incoming
> telnet connections, and disconnect my PPP connection..  if it's not then
> it will just keep on running until is..  Anywhere on how I would attempt
> to do this.. I don't know how to shell program so I wouldn't know where to
> start..

Hello Matthew,

A shell command that you can use to kill pppd is:

               kill -HUP `cat /var/run/ppp0.pid`

The back-tics will replace the cat command with its output which is the
pid that is contained in the file /var/run/ppp0.pid.  (You may want to
check that this is indeed the filename used on your system by taking
a look in the /var/run directory when pppd is running).  Note that you
will have to be root for this command to work.

As far as running a command to warn your users that pppd is going down,
I'm not quite sure what will work there.  I know that for people that are
on your system via a terminal session, you can use wall.  I don't think
that will work for a user that is visiting your site via netscape or ftp.
Perhaps someone else can advise you on this.

Finally, to run programs at specific times, be they shell commands or
otherwise you can use the cron facility.  Cron's man page is quite well
written and has a number of illustrative examples. 

Hope this helps.

Best regards,
                               Nick

--------------------------------------------------------------------------
Nick Busigin     <Sent from my Debian/GNU Linux Machine>    nick@xwing.org

To obtain my pgp public key, email me with the subject: "get pgp-key"
--------------------------------------------------------------------------


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: