diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-04 16:54:45 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-04 16:54:45 +0000 |
commit | 214511aafc65d340174c93703efd1e158b076be1 (patch) | |
tree | 67d1dc34541ac85f7196fb2347ac16b921b51538 /contrib/package/freifunk-watchdog/files/freifunk-watchdog.init | |
parent | d9fd5a4c9e422f038260e645b227c416a2edf350 (diff) |
contrib/package: add freifunk watchdog daemon
Diffstat (limited to 'contrib/package/freifunk-watchdog/files/freifunk-watchdog.init')
-rwxr-xr-x | contrib/package/freifunk-watchdog/files/freifunk-watchdog.init | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/package/freifunk-watchdog/files/freifunk-watchdog.init b/contrib/package/freifunk-watchdog/files/freifunk-watchdog.init new file mode 100755 index 000000000..9ca43754d --- /dev/null +++ b/contrib/package/freifunk-watchdog/files/freifunk-watchdog.init @@ -0,0 +1,24 @@ +#!/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 + + start +} + +start() +{ + start-stop-daemon -q -b -m -p $PID -x $BIN -S +} + +stop() +{ + start-stop-daemon -q -p $PID -x $BIN -K +} |