luci/contrib/package/freifunk-watchdog/files/freifunk-watchdog.init
Jo-Philipp Wich 89afc3a1d5 contrib/package/freifunk-watchdog:
- poll /dev/watchdog if available
	- also monitor dropbear
2009-05-12 22:16:24 +00:00

28 lines
444 B
Bash
Executable file

#!/bin/sh /etc/rc.common
START=99
PID=/var/run/ffwatchd.pid
BIN=/usr/sbin/ffwatchd
boot()
{
if ! grep -q "$BIN" /etc/crontabs/root 2>/dev/null; then
echo "* * * * * $BIN running || /etc/init.d/freifunk-watchdog restart" >> /etc/crontabs/root
fi
if lsmod | grep -q softdog; then
mknod /dev/watchdog c 10 130
fi
start
}
start()
{
start-stop-daemon -q -b -m -p $PID -x $BIN -S
}
stop()
{
start-stop-daemon -q -p $PID -x $BIN -K
}