summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-qos
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-01-10 00:00:03 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-01-10 00:00:03 +0000
commit12df938e98b2ceb9a6edd50f0cf4febb8aebd45f (patch)
tree9048a56ddc6c1ecf5c54d7ba11c7b8358b568665 /applications/luci-qos
parent69a377e302436f61cda073791255628d52a3e692 (diff)
applications/luci-qos: cope with reorganized L7 patterns
Diffstat (limited to 'applications/luci-qos')
-rw-r--r--applications/luci-qos/luasrc/model/cbi/qos/qos.lua7
-rw-r--r--applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua7
2 files changed, 8 insertions, 6 deletions
diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua
index af481fd3a..4891dbbdc 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 503ad10a2..c775ece73 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