From 61778a32394378c6b120a290739984f3c9c812ce Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Mon, 10 Oct 2011 16:04:27 +0000 Subject: modules/freifunk: Make display of ipv4 default route in public status work with freifunk-policyrouting enabled --- modules/freifunk/luasrc/controller/freifunk/freifunk.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'modules/freifunk/luasrc/controller') diff --git a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua index 89cd0ff50..1d0175ff1 100644 --- a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua +++ b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua @@ -51,7 +51,7 @@ function index() page.order = 20 page.i18n = "base" page.setuser = false - page.setgroup = false + page.setgroup = false entry({"freifunk", "status.json"}, call("jsonstatus")) entry({"freifunk", "status", "zeroes"}, call("zeroes"), "Testdownload") @@ -292,7 +292,18 @@ function public_status_json() dest = dr4.dest:string(), dev = dr4.device, metr = dr4.metric } - end + else + local dr = sys.exec("ip r s t olsr-default") + if dr then + local dest, gateway, dev, metr = dr:match("^(%w+) via (%d+.%d+.%d+.%d+) dev (%w+) +metric (%d+)") + def4 = { + dest = dest, + gateway = gateway, + dev = dev, + metr = metr + } + end + end rv[#rv+1] = { time = os.date("%a, %d %b %Y, %H:%M:%S"), -- cgit v1.2.3