From: Jo-Philipp Wich Date: Mon, 10 Jan 2011 00:00:03 +0000 (+0000) Subject: applications/luci-qos: cope with reorganized L7 patterns X-Git-Tag: 0.10.0~235 X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=12df938e98b2ceb9a6edd50f0cf4febb8aebd45f applications/luci-qos: cope with reorganized L7 patterns --- diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua index af481fd3aa..4891dbbdc8 100644 --- a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua +++ b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua @@ -64,11 +64,12 @@ wa.cbi_add_knownips(dsth) l7 = s:option(ListValue, "layer7", translate("Service")) l7.rmempty = true l7:value("", translate("all")) -local pats = fs.dir("/etc/l7-protocols") +local pats = fs.glob("/etc/l7-protocols/*/*.pat") if pats then for f in pats do - if f:sub(-4) == ".pat" then - l7:value(f:sub(1, #f-4)) + f = f:match("([^/]+)%.pat$") + if f then + l7:value(f) end end end diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua b/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua index 503ad10a28..c775ece730 100644 --- a/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua +++ b/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua @@ -50,11 +50,12 @@ wa.cbi_add_knownips(dsth) l7 = s:option(ListValue, "layer7", translate("Service")) l7.rmempty = true l7:value("", translate("all")) -local pats = fs.dir("/etc/l7-protocols") +local pats = fs.glob("/etc/l7-protocols/*/*.pat") if pats then for f in pats do - if f:sub(-4) == ".pat" then - l7:value(f:sub(1, #f-4)) + f = f:match("([^/]+)%.pat$") + if f then + l7:value(f) end end end