Re: Checking length of time?
On Monday 18 October 2004 01:33, disciple wrote:
> I have set up a bare debian system that allows internet sharing through
> a dial up connection. My ISP only allows 8 hours of a constant
> connection b4 they log you off. I have 2 questions.
>
> 1. How do I check the status of the connection... ie the length of time
> that my debian box has been connected?
in the if-up scripts write the current date into a file use the %s format on
the date command (seconds since 1970)
>
> 2. How can I set my box up to automatically disconnect after say about
> 7.5 hours, and then reconnect?
run a cron job every 15 minutes which compares current time (as seconds since
1970) with the time put into the date file above and take the connection down
and up if the time is longer that 7.5 hours.
--
Alan Chandler
alan@chandlerfamily.org.uk
First they ignore you, then they laugh at you,
then they fight you, then you win. --Gandhi
Reply to: