View Full Version : Auto-Fixing Script
boboli
03-25-2005, 08:25 AM
How hard/easy/feasible would it be to come up with a script that would survive an update and ping a server every xx minutes and, when it does not get a response, would run another script?
B
cojonesdetoro
03-25-2005, 07:10 PM
How hard/easy/feasible would it be to come up with a script that would survive an update and ping a server every xx minutes and, when it does not get a response, would run another script?
B
I'm not sure what "survive an update" means.
script should be easy if you install cron and run it from there. Cron is a tool to do stuff on a specified schedule.
This works on my S1 tivo but YMMV if you have a different 'ping' binary:
ping -c1 -t5 192.168.44.2 && echo ping was good
If the ping is good then the stuff after the "&&" is run.
It times out after 5 seconds.
"||" as is the opposite of "&&"
boboli
03-25-2005, 07:35 PM
I'm not sure what "survive an update" means.
script should be easy if you install cron and run it from there. Cron is a tool to do stuff on a specified schedule.
This works on my S1 tivo but YMMV if you have a different 'ping' binary:
ping -c1 -t5 192.168.44.2 && echo ping was good
If the ping is good then the stuff after the "&&" is run.
It times out after 5 seconds.
"||" as is the opposite of "&&"
So, using your format.....
ping -c1 -t5 192.168.44.2 || /hack/nic_install/nic_install turbonet
Now, the only thing I would need to figure out is how to make 'nic_install' work from console.....
Thanx :D
B
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.