From 214511aafc65d340174c93703efd1e158b076be1 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 4 May 2009 16:54:45 +0000 Subject: contrib/package: add freifunk watchdog daemon --- .../freifunk-watchdog/files/freifunk-watchdog.init | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 contrib/package/freifunk-watchdog/files/freifunk-watchdog.init (limited to 'contrib/package/freifunk-watchdog/files') 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 0000000000..9ca43754d7 --- /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 +} -- cgit v1.2.3