diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-12-21 10:15:36 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2018-12-21 10:33:24 +0100 |
commit | 99bac545ee242f62f7750d7bf393906669c59c00 (patch) | |
tree | 6fb65f6b894353d0b69950179c3214c69cf54c73 /applications/luci-app-mwan3/luasrc/model | |
parent | f9b634f95b06d2618a3742089cd64e80da0149fd (diff) |
luci-app-mwan3: show supported tracking methodes if needed bin is installed
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/model')
-rw-r--r-- | applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua index a1880b3a9..4c970d4fa 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua @@ -34,12 +34,20 @@ track_ip.datatype = "host" track_method = mwan_interface:option(ListValue, "track_method", translate("Tracking method")) track_method.default = "ping" track_method:value("ping") -track_method:value("nping-tcp") -track_method:value("nping-udp") -track_method:value("nping-icmp") -track_method:value("nping-arp") -track_method:value("arping") -track_method:value("httping") +if os.execute("which nping 1>/dev/null") == 0 then + track_method:value("nping-tcp") + track_method:value("nping-udp") + track_method:value("nping-icmp") + track_method:value("nping-arp") +end + +if os.execute("which arping 1>/dev/null") == 0 then + track_method:value("arping") +end + +if os.execute("which httping 1>/dev/null") == 0 then + track_method:value("httping") +end reliability = mwan_interface:option(Value, "reliability", translate("Tracking reliability"), translate("Acceptable values: 1-100. This many Tracking IP addresses must respond for the link to be deemed up")) |