#!/bin/sh hook_name="ping_watchdog" function hook_is_installed() { installed=yes } function hook_check() { local testAddresses="172.16.8.$(seq -s ' 172.16.8.' 1 10) sf.net 8.8.8.8" local hostAddresses="$(ip address show)" status=error for addr in ${testAddresses} ; do (echo "${hostAddresses}" | grep -q -w -F ${addr}) && continue ping -w 3 -c 2 ${addr} &> /dev/null && { status=ok break } done } function hook_quickfix() { true } function hook_longfix() { log="Ping watch-dog failed maybe the device got dumb: rebooting" reboot }