how to run script on event ppp0 interface going down ?
Hello Fellow Penguin Huggers :)
i have a sucky dial-up ISP that hangs up every 2 hours of connection time. and i want to leave my pc overnight to download large files. is there anyway i could detect that the internet has gone down, and run this sequence of commands.... Quote:
|
Hi.
I think I've got it. Start this script. You'll have to run it as root to get access to ifconfig. Adjust the sleep number to suit (it's 5 seconds at the moment - that's probably a bit short, YMMV) Here's the script: Code:
#!/bin/bash Hope that helps. Dave Edit: Added & to end of wget -ci line |
ah yes, that works great thanks !!
i though about somthing similar but decided it would eat all my cpu... didnt realise BASH had a sleep function lol.... thanX for the script. |
Did you get the last edit? The ampersand's important.
Dave |
yep thats in there...
(also had to change ifconfig to /sbin/ifconfig if any1 else is reading this) thanKs |
All times are GMT -5. The time now is 01:46 PM. |