remove .i18n annotations from controller files
[project/luci.git] / applications / luci-commands / luasrc / controller / commands.lua
index 9fbde94c6aa7eb74015ae4bf2c2422fbd7336c51..b9f0ce8794cc1f94cba7ff0f662d6d80c5529e31 100644 (file)
@@ -14,7 +14,7 @@ You may obtain a copy of the License at
 module("luci.controller.commands", package.seeall)
 
 function index()
-       entry({"admin", "system", "commands"}, firstchild(), _("Custom Commands"), 80).i18n = "commands"
+       entry({"admin", "system", "commands"}, firstchild(), _("Custom Commands"), 80)
        entry({"admin", "system", "commands", "dashboard"}, template("commands"), _("Dashboard"), 1)
        entry({"admin", "system", "commands", "config"}, cbi("commands"), _("Configure"), 2)
        entry({"admin", "system", "commands", "run"}, call("action_run"), nil, 3).leaf = true
@@ -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)