buc99
Don't Tread on Me!
I hope someone out ther that can write Unix scripts can give me a hand with this idea.
Idea:
I would like to write a script that does the following:
1.) It would run ping www.yahoo.com and look for results. Basically,
I've noticed that when my cable connection does not refresh my
dynamic address ping will hang when run from the terminal with
no response. So if this is the case, I would like the script to check for
a response from ping and execute the next item if there is no
response. If there is a response, it would terminate ping and exit.
2.) If no response comes from ping, the script would then enter the
command "shutdown -r now". This would restart the computer and all
of the network settings. This is the only way I know of that works for
resetting my dynamic IP.
The first part is the main hangup for me because I'm not a skilled script writer. With this script written, I could then make it executable and use cron to run the script every 30 minutes or so. This does not fix my cable modem connection problem but would work as a bandaid solution if I have the login set to login automatically. This would then keep my webserver up with minimal interuption. Anyone able to give me some help with this?
Thanks in advance,
SA
Idea:
I would like to write a script that does the following:
1.) It would run ping www.yahoo.com and look for results. Basically,
I've noticed that when my cable connection does not refresh my
dynamic address ping will hang when run from the terminal with
no response. So if this is the case, I would like the script to check for
a response from ping and execute the next item if there is no
response. If there is a response, it would terminate ping and exit.
2.) If no response comes from ping, the script would then enter the
command "shutdown -r now". This would restart the computer and all
of the network settings. This is the only way I know of that works for
resetting my dynamic IP.
The first part is the main hangup for me because I'm not a skilled script writer. With this script written, I could then make it executable and use cron to run the script every 30 minutes or so. This does not fix my cable modem connection problem but would work as a bandaid solution if I have the login set to login automatically. This would then keep my webserver up with minimal interuption. Anyone able to give me some help with this?
Thanks in advance,

SA