summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-banip/luasrc/controller/banip.lua
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-banip/luasrc/controller/banip.lua')
-rw-r--r--applications/luci-app-banip/luasrc/controller/banip.lua14
1 files changed, 4 insertions, 10 deletions
diff --git a/applications/luci-app-banip/luasrc/controller/banip.lua b/applications/luci-app-banip/luasrc/controller/banip.lua
index e201295d5f..42328d7ea4 100644
--- a/applications/luci-app-banip/luasrc/controller/banip.lua
+++ b/applications/luci-app-banip/luasrc/controller/banip.lua
@@ -1,4 +1,4 @@
--- Copyright 2018 Dirk Brenken (dev@brenken.org)
+-- Copyright 2018-2019 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
module("luci.controller.banip", package.seeall)
@@ -30,8 +30,8 @@ function index()
end
function ban_action(name)
- if name == "do_refresh" then
- luci.sys.call("/etc/init.d/banip start >/dev/null 2>&1")
+ if name == "do_reload" then
+ luci.sys.call("/etc/init.d/banip reload >/dev/null 2>&1")
end
luci.http.prepare_content("text/plain")
luci.http.write("0")
@@ -51,13 +51,7 @@ function status_update()
end
function log_view()
- local content
-
- if nixio.fs.access("/var/log/messages") then
- content = util.trim(util.exec("grep -F 'banIP-' /var/log/messages"))
- else
- content = util.trim(util.exec("logread -e 'banIP-' 2>/dev/null"))
- end
+ local content = util.trim(util.exec("logread -e 'banIP-' 2>/dev/null")) or ""
if content == "" then
content = "No banIP related logs yet!"