Re: Checking length of time?
From: Alexis Huxley (ahuxley_at_gmx.net)
Date: 10/18/04
- Previous message: Ritesh Raj Sarraf: "Re: x-windows configuration in woody/sarge"
- In reply to: disciple: "Checking length of time?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: debian-user@lists.debian.org Date: Mon, 18 Oct 2004 07:39:13 +0000 (UTC)
> 1. How do I check the status of the connection... ie the length of time
> that my debian box has been connected?
You can find the last connection time by grepping for "remote IP address"
in /var/log/messages. Then you can use 'date -d <datestring> +%s' to
convert this to seconds since 1970, you can also get the time now
expressed as seconds since 1970 with 'date +%s' then subtract one from
the other and you've got the number of seconds you've been connected.
The rest is straightforward.
> 2. How can I set my box up to automatically disconnect after say about
> 7.5 hours, and then reconnect?
Set up a script in /etc/ip-up.d that runs something like:
#!/bin/sh
( sleep 27000; killall ppd ) &
(Not tested.)
Hope that helps ..
Alexis
-- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: Ritesh Raj Sarraf: "Re: x-windows configuration in woody/sarge"
- In reply to: disciple: "Checking length of time?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|