in

Wiki suggestion for "ping_watchdog" script

Last post Sat, Jun 27 2009 6:07 PM by brett. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • Sat, Jun 27 2009 6:07 PM

    • brett
    • Top 10 Contributor
    • Joined on Mon, Jun 4 2007
    • Posts 90

    Wiki suggestion for "ping_watchdog" script

     Just a couple quick suggestions:

    1) Both ping_watchdog and rc.local will need to be executable to run, so they need to be chmod +x. (scp keeps the executable flag, so alternatively you could edit these files on a local linux machine, chmod +x them, and then scp them in without ever having to log in to the remote host. This works because the new DLB APs fully support scp, which is great!)

    2) It looks like rc.local is loaded before the interfaces are bridged, I think? On an AP that was using WDS as its uplink 60 seconds wasn't enough of a delay -- it kept rebooting, etc. So I added this before the "while true" line:

    while [ $(uptime | cut -f2 -d' ' | cut -f1 -d':') -le 1 ]
    do
            echo Uptime less than 1 hour, sending packets and sleeping
            ping -c $COUNT $HOST > /dev/null
            sleep 60
    done

    So for an hour after a boot, this would send the "keepalive" packets (that seem to help out in some instances) every 60 seconds while not issuing any reboot commands. Once the hour is up, the while loop closes and goes on to the main while loop to auto reboot when necessary etc.

Page 1 of 1 (1 items)
Copyright Deliberant LLC. All rights reserved.