contrib/package/freifunk-watchdog: nuke cronjob if wd is disabled and stop is invoked
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 16 May 2009 17:30:01 +0000 (17:30 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 16 May 2009 17:30:01 +0000 (17:30 +0000)
contrib/package/freifunk-watchdog/files/freifunk-watchdog.init

index 1f87bf7..d6ede09 100755 (executable)
@@ -30,4 +30,10 @@ start()
 stop()
 {
        start-stop-daemon -q -p $PID -x $BIN -K
+
+       if ! /etc/init.d/freifunk-watchdog enabled; then
+               if grep -q "$BIN" /etc/crontabs/root 2>/dev/null; then
+                       sed -i -e "\\'$BIN'd" /etc/crontabs/root
+               fi
+       fi
 }