Remove Lua dependency from LuCI integration
This commit is contained in:
1 parent
bdd16d3c22
commit
d049e272ec
9 files changed
+338
-236
No files matched your search
@@ -1,23 +0,0 @@
|
||||
module("luci.controller.owrt_full_backup", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "services", "owrt-full-backup"}, call("action_open"), "OpenWrt Full Backup", 90).dependent = false
|
||||
end
|
||||
|
||||
function action_open()
|
||||
local http = require "luci.http"
|
||||
local fs = require "nixio.fs"
|
||||
local key = fs.readfile("/etc/owrt-full-backup/web.key") or ""
|
||||
|
||||
key = key:gsub("%s+", "")
|
||||
if key == "" then
|
||||
http.prepare_content("text/html; charset=utf-8")
|
||||
http.write("<!doctype html><html><head><meta charset=\"utf-8\"><title>OpenWrt Full Backup</title></head><body>")
|
||||
http.write("<h1>OpenWrt Full Backup</h1>")
|
||||
http.write("<p>Веб-ключ не найден. Переустанови модуль командой <code>sh install.sh</code>.</p>")
|
||||
http.write("</body></html>")
|
||||
return
|
||||
end
|
||||
|
||||
http.redirect("/cgi-bin/owrt-full-backup?key=" .. key)
|
||||
end
|
||||
Reference in new issue
Block a user