I guess the problem here is that if the interface is down the ping will cause it to come up - forcing the ping to be always true.
If the pppd has a startup delay and you force ping to only send one or two packets, though, then this approach might work.
My solution would be to have the 'ifup' script touch a file in /tmp, and the 'ifdown' script remove it.
Then, barring crashes/weirdness testing the connection status is as simple as testing for the existence of the file in /tmp.
Steve
---
steve.org.uk
|