1 #!/bin/sh /etc/rc.common
4 PID=/var/run/ffwatchd.pid
9 # If watchdog service is enabled, install cronjob, create device node and start daemon
10 if /etc/init.d/freifunk-watchdog enabled 2>/dev/null; then
11 if ! grep -q "$BIN" /etc/crontabs/root 2>/dev/null; then
12 echo "* * * * * $BIN running || /etc/init.d/freifunk-watchdog restart" >> /etc/crontabs/root
15 mknod /dev/watchdog c 10 130
19 # If service is disabled, find and remove related cronjob
20 elif grep -q "$BIN" /etc/crontabs/root 2>/dev/null; then
21 sed -i -e "\\'$BIN'd" /etc/crontabs/root
27 start-stop-daemon -q -b -m -p $PID -x $BIN -S
32 start-stop-daemon -q -p $PID -x $BIN -K
34 if ! /etc/init.d/freifunk-watchdog enabled; then
35 if grep -q "$BIN" /etc/crontabs/root 2>/dev/null; then
36 sed -i -e "\\'$BIN'd" /etc/crontabs/root