8b280cd51f0d7bf1c3ed03ee32665524deec6b94
[project/luci.git] / modules / freifunk / root / etc / init.d / freifunk
1 #!/bin/sh /etc/rc.common
2 # Freifunk Init
3 # $Id$
4
5 START=99
6
7 boot() {
8         test -f /etc/crontabs/root || touch /etc/crontabs/root
9
10         grep -q 'killall -HUP dnsmasq' /etc/crontabs/root || {
11                 echo "*/5 * * * *       killall -HUP dnsmasq" >> /etc/crontabs/root
12         }
13
14         grep -q '/usr/sbin/ff_olsr_test_gw' /etc/crontabs/root || {
15                 echo "* * * * *         /usr/sbin/ff_olsr_test_gw" >> /etc/crontabs/root
16         }
17
18         grep -q '/usr/sbin/ff_olsr_watchdog' /etc/crontabs/root || {
19                 echo "*/5 * * * *       /usr/sbin/ff_olsr_watchdog" >> /etc/crontabs/root
20         }
21
22         grep -q '/usr/sbin/ff_rdate' /etc/crontabs/root || {
23                 echo "0 */4 * * *       /usr/sbin/ff_rdate" >> /etc/crontabs/root
24         }
25
26         grep -q '/usr/sbin/ff_mapupdate' /etc/crontabs/root || {
27                 echo "17 * * * *        /usr/sbin/ff_mapupdate" >> /etc/crontabs/root
28         }
29
30         [ -f /etc/rc.local ] && . /etc/rc.local
31         [ -d /etc/rc.local.d ] && {
32                 for file in /etc/rc.local.d/*; do
33                         test -f "$file" && . "$file"
34                 done
35         }
36
37         ( /usr/sbin/ff_rdate; /etc/init.d/cron restart ) &
38 }