X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-nlbwmon%2Fluasrc%2Fcontroller%2Fnlbw.lua;h=bb56bc6e6eb7bc297d6c7b96203ee3e4397a21bb;hp=4f41bb8c312192ef02d0c13045645c060e0d94f2;hb=3722aa02861d53d356a73a1ddc4fc2a2cd610617;hpb=2523e0f479e2bd8c3d403637df03c6bb6c4a2d85 diff --git a/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua b/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua index 4f41bb8c3..bb56bc6e6 100644 --- a/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua +++ b/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua @@ -13,6 +13,7 @@ function index() entry({"admin", "nlbw", "ptr"}, call("action_ptr"), nil, 6).leaf = true entry({"admin", "nlbw", "download"}, call("action_download"), nil, 7) entry({"admin", "nlbw", "restore"}, post("action_restore"), nil, 8) + entry({"admin", "nlbw", "commit"}, call("action_commit"), nil, 9) end local function exec(cmd, args, writer) @@ -214,3 +215,11 @@ function action_restore() table.concat(output, ", ")) }) end + +function action_commit() + local http = require "luci.http" + local disp = require "luci.dispatcher" + + http.redirect(disp.build_url("admin/nlbw/display")) + exec("/usr/sbin/nlbw", { "-c", "commit" }) +end