Hi all yet again,
I have my box dialing on boot, and I recently had a problem that caused 400
dialups to happend and cost me a packet.
So,, I have it all working again... but now I want to do something
different.
I am thinking of writing a shell script... and I need it to do the
following..
1. start on dialup. (add it to the ip.local file in /ppp)
2. keep a count of the time, and the number of dialup attempts per hour (or
minute or whatever)
3. If the box has attempted to connect more then 5 times in an hour I want
the script to completely kill pppd and ifup.... after an hour or two has
passed try twice more if both of them fail, then killall pppd and ifup
permanently.
That will or should stop the problem from happening again..
What I need to do this,, is some way of detecting if a connection is
active..
(and I don't mean by pinging or something like that.)
what can I test internally to see if a ppp connection is open?
Also, how do I assign time to a variable so that I can compare the times..
(or is there an easier way to do this?)
lastly, has anyone heard of a tool like this?
regards
Frank