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

Re: Checking length of time?



> 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



Reply to: