Dear All,
On 02/11/2010 03:16 AM, Tejas Guruswamy wrote:
On 11/02/10 04:03, Wong wrote:
Thanks for your advise & useful script.
I tried to run it foreground and get this message:
/usr/local/sbin/dslcheck: line 9: trap: cleanup: invalid signal specification That's because it should be INT TERM EXIT , not SIGINT SIGTERM EXIT. Also only one "trap cleanup" -- it seems to be duplicated for some reason.
Basically it should look like this trap cleanup INT TERM EXIT
Regards, Tejas
Tejas,
You and Dave are correct. I must have been tired :-)
Dave, picky, picky :p. 'echo "$$" > $runfile' is better, because you do actually store something useful in $runfile, but since I was just testing for existence, touch would work just fine ;-). I agree it should be 'rm -f' we don't want any confirmation questions.
Good to with you Dave. One of these days, if just once, I'll actually 'snatch the pebbles from your hand' :p
Thanks to all. This discussion help me to find solution for DSL link disconnection cause by many problems. In my area, most of DSL problem caused by provider and my SuSE cannot wake up automatically the dsl0 interface when service restore. I tried the script, manual load and test to restart the DSL modem. However, the script seems cannot run as expected. Below the script I run: ---------- #!/bin/bash runfile=/tmp/chkdsl0.run cleanup() { rm -rf $runfile } trap cleanup INT TERM EXIT if [[ ! -f $runfile ]]; then touch $runfile while :; do if ! ping -q -c1 w.x.y.z &>/dev/null; then rcnetwork restart # (as root, or 'sudo rcnetwork restart' with sudo) fi sleep 600 done fi exit 0 ---------- *** w.x.y.z is my router at provider site Please advise what wrong is it? Thanks a lot ! Wong -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org