diff options
Diffstat (limited to 'contrib/package/freifunk-common/files/etc/init.d')
-rwxr-xr-x | contrib/package/freifunk-common/files/etc/init.d/freifunk | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/package/freifunk-common/files/etc/init.d/freifunk b/contrib/package/freifunk-common/files/etc/init.d/freifunk new file mode 100755 index 0000000000..5ffec43e83 --- /dev/null +++ b/contrib/package/freifunk-common/files/etc/init.d/freifunk @@ -0,0 +1,29 @@ +#!/bin/sh /etc/rc.common +# Freifunk Init +# $Id$ + +START=99 + +boot() { + test -f /etc/crontabs/root || touch /etc/crontabs/root + + grep -q 'killall -HUP dnsmasq' /etc/crontabs/root || { + echo "*/5 * * * * killall -HUP dnsmasq" >> /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 + } + + [ -d /etc/rc.local.d ] && { + for file in /etc/rc.local.d/*; do + test -f "$file" && . "$file" + done + } + + ( sleep 40; /usr/sbin/ff_rdate; /etc/init.d/cron restart ) & +} |