modules/freifunk: setup config and cron jobs for rdate; sync time on boot
[project/luci.git] / modules / freifunk / root / etc / init.d / freifunk
index 61bd580..79bcbc7 100755 (executable)
@@ -13,6 +13,14 @@ boot() {
                echo "* * * * *         /usr/sbin/ff_olsr_test_gw" >> /etc/crontabs/root
        }
 
+       grep -q '/usr/sbin/ff_olsr_watchdog' /etc/crontabs/root || {
+               echo "*/5 * * * *       /usr/sbin/ff_olsr_watchdog" >> /etc/crontabs/root
+       }
+
+       grep -q '/usr/sbin/ff_rdate' /etc/crontabs/root || {
+               echo "0 */4 * * *       /usr/sbin/ff_rdate >> /etc/crontabs/root
+       }
+
        [ -f /etc/rc.local ] && . /etc/rc.local
        [ -d /etc/rc.local.d ] && {
                for file in /etc/rc.local.d/*; do
@@ -20,5 +28,5 @@ boot() {
                done
        }
 
-       killall -HUP crond 2>/dev/null || /etc/init.d/cron start
+       ( /usr/sbin/ff_rdate; /etc/init.d/cron restart ) &
 }