diff options
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-commands/luasrc/controller/commands.lua | 7 | ||||
-rw-r--r-- | applications/luci-upnp/luasrc/controller/upnp.lua | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/applications/luci-commands/luasrc/controller/commands.lua b/applications/luci-commands/luasrc/controller/commands.lua index 9fbde94c6..c04d186bb 100644 --- a/applications/luci-commands/luasrc/controller/commands.lua +++ b/applications/luci-commands/luasrc/controller/commands.lua @@ -141,9 +141,7 @@ local function parse_args(str) end local function parse_cmdline(cmdid, args) - local uci = require "luci.model.uci".cursor() - local path = luci.dispatcher.context.requestpath - + local uci = require "luci.model.uci".cursor() if uci:get("luci", cmdid) == "command" then local cmd = uci:get_all("luci", cmdid) local argv = parse_args(cmd.command) @@ -228,7 +226,8 @@ end function action_public(cmdid, args) local uci = require "luci.model.uci".cursor() - if uci:get("luci", cmdid) == "command" and + if cmdid and + uci:get("luci", cmdid) == "command" and uci:get("luci", cmdid, "public") == "1" then action_download(cmdid, args) diff --git a/applications/luci-upnp/luasrc/controller/upnp.lua b/applications/luci-upnp/luasrc/controller/upnp.lua index c40493dab..b5eaad5c9 100644 --- a/applications/luci-upnp/luasrc/controller/upnp.lua +++ b/applications/luci-upnp/luasrc/controller/upnp.lua @@ -69,10 +69,8 @@ function act_status() end end -function act_delete() - local path = luci.dispatcher.context.requestpath - local idx = tonumber(path[#path]) - +function act_delete(idx) + idx = tonumber(idx) if idx and idx > 0 then luci.sys.call("iptables -t filter -D MINIUPNPD %d 2>/dev/null" % idx) luci.sys.call("iptables -t nat -D MINIUPNPD %d 2>/dev/null" % idx) |