summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/freifunk-policyrouting/files/etc/init.d
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2012-02-24 21:08:18 +0000
committerManuel Munz <freifunk@somakoma.de>2012-02-24 21:08:18 +0000
commit7e9d0c3c92e9d92b851b74a1c2d883773e9adc8d (patch)
tree64ab4557354c0bec2e3b9e8195b9a83a32f2bb00 /contrib/package/freifunk-policyrouting/files/etc/init.d
parent0453e50932ab03c172ef18727673a2d874d93c52 (diff)
contrib/freifunk-policyrouting: make sure olsr routing table entries are removed on boot when policy routing is disabled and wan is not connected and therefore there is no hotplug event fired
Diffstat (limited to 'contrib/package/freifunk-policyrouting/files/etc/init.d')
-rwxr-xr-xcontrib/package/freifunk-policyrouting/files/etc/init.d/freifunk-policyrouting13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/package/freifunk-policyrouting/files/etc/init.d/freifunk-policyrouting b/contrib/package/freifunk-policyrouting/files/etc/init.d/freifunk-policyrouting
new file mode 100755
index 0000000000..00730b0212
--- /dev/null
+++ b/contrib/package/freifunk-policyrouting/files/etc/init.d/freifunk-policyrouting
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+
+START=60
+
+boot()
+{
+ prenabled=$(uci get freifunk-policyrouting.pr.enable)
+ if [ ! "$prenabled" = "1" ]; then
+ uci -q delete olsrd.@olsrd[0].RtTable
+ uci -q delete olsrd.@olsrd[0].RtTableDefault
+ uci commit olsrd
+ fi
+}