From: Manuel Munz Date: Fri, 24 Feb 2012 21:08:18 +0000 (+0000) Subject: contrib/freifunk-policyrouting: make sure olsr routing table entries are removed... X-Git-Tag: 0.11.0~1025 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7e9d0c3c92e9d92b851b74a1c2d883773e9adc8d;p=oweals%2Fluci.git 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 --- 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 000000000..00730b021 --- /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 +} diff --git a/contrib/package/freifunk-policyrouting/files/etc/rc.d/S60-freifunk-policyrouting b/contrib/package/freifunk-policyrouting/files/etc/rc.d/S60-freifunk-policyrouting new file mode 120000 index 000000000..3c3dad87d --- /dev/null +++ b/contrib/package/freifunk-policyrouting/files/etc/rc.d/S60-freifunk-policyrouting @@ -0,0 +1 @@ +../init.d/freifunk-policyrouting \ No newline at end of file