diff options
author | Manuel Munz <freifunk@somakoma.de> | 2011-09-23 19:25:32 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2011-09-23 19:25:32 +0000 |
commit | 2b5c41037e2bee817bb0af3065c412a44bdec8c9 (patch) | |
tree | b9594b5f0575f6ef0bce15b5f8cb34af67420a5f /modules | |
parent | d8e4734b23016cea5c5099f84a7f2ffbab8e6216 (diff) |
modules/freifunk: Remove ff_olsr_test_gw
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/freifunk/root/etc/init.d/freifunk | 4 | ||||
-rwxr-xr-x | modules/freifunk/root/usr/sbin/ff_olsr_test_gw | 41 |
2 files changed, 0 insertions, 45 deletions
diff --git a/modules/freifunk/root/etc/init.d/freifunk b/modules/freifunk/root/etc/init.d/freifunk index f5248698a4..ed1364e001 100755 --- a/modules/freifunk/root/etc/init.d/freifunk +++ b/modules/freifunk/root/etc/init.d/freifunk @@ -11,10 +11,6 @@ boot() { echo "*/5 * * * * killall -HUP dnsmasq" >> /etc/crontabs/root } - grep -q '/usr/sbin/ff_olsr_test_gw' /etc/crontabs/root || { - 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 } diff --git a/modules/freifunk/root/usr/sbin/ff_olsr_test_gw b/modules/freifunk/root/usr/sbin/ff_olsr_test_gw deleted file mode 100755 index 5c47b498db..0000000000 --- a/modules/freifunk/root/usr/sbin/ff_olsr_test_gw +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/lua -local STRICT = true -- Only delete metric 0 routes -local PINGCMD = "ping -q -I%s -c3 -w3 '%s' >/dev/null 2>&1" -local PINGTRG = {"google.de", "www.de.debian.org", "eu.kernel.org", "freifunk.net"} -local ROUTECMD = "route del default gw '%s' >/dev/null 2>&1" -local THRESHOLD = 3 -- Maximum number of failed tests before dropping the route - -local sys = require "luci.sys" -local uci = require "luci.model.uci".cursor_state() -local ucisec = "ff_olsr_test_gw" -local section = nil - -uci:foreach("olsrd", "LoadPlugin", function(s) - if s.library == "olsrd_dyn_gw_plain.so.0.4" and s.ignore ~= "1" then - section = s[".name"] - end -end) - -local droute = sys.net.defaultroute() -if section and droute then -- dyn_gw is enabled and we have a defaultroute, test it - local state = false - - for _, host in ipairs(PINGTRG) do - state = state or (sys.call(PINGCMD % {droute.device, host}) == 0) - end - - if not state and (not STRICT or tonumber(droute.metric) == 0) then - local count = tonumber(uci:get("olsrd", ucisec, "noinet_count")) - if not THRESHOLD or (count and count >= THRESHOLD) then - sys.call(ROUTECMD % droute.gateway:string()) - else - if not count then - uci:set("olsrd", ucisec, "state") - end - uci:set("olsrd", ucisec, "noinet_count", (count or 0) + 1) - uci:save("olsrd") - end - else - uci:revert("olsrd", ucisec) - end -end |