mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 00:35:13 +08:00
update 2026-08-15 20:26:22
This commit is contained in:
1 parent
d5fe2d005a
commit
a459a74f19
32 files changed
+1991
-1606
No files matched your search
@@ -249,7 +249,7 @@ end
|
||||
function get_redir_log()
|
||||
local id = http.formvalue("id")
|
||||
local name = http.formvalue("name")
|
||||
local file_path = "/tmp/etc/passwall2/acl/" .. id .. "/" .. name .. ".log"
|
||||
local file_path = api.TMP_PATH .. "/acl/" .. id .. "/" .. name .. ".log"
|
||||
if nixio.fs.access(file_path) then
|
||||
local content = luci.sys.exec("tail -n 19999 '" .. file_path .. "'")
|
||||
content = content:gsub("\n", "<br />")
|
||||
@@ -261,7 +261,7 @@ end
|
||||
|
||||
function get_socks_log()
|
||||
local name = http.formvalue("name")
|
||||
local path = "/tmp/etc/passwall2/" .. name .. ".log"
|
||||
local path = api.TMP_PATH .. "/" .. name .. ".log"
|
||||
if nixio.fs.access(path) then
|
||||
local content = luci.sys.exec("tail -n 5000 ".. path)
|
||||
content = content:gsub("\n", "<br />")
|
||||
@@ -294,7 +294,7 @@ end
|
||||
|
||||
function index_status()
|
||||
local e = {}
|
||||
e["global_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '/tmp/etc/passwall2/bin/' | grep 'default' | grep 'global' >/dev/null") == 0
|
||||
e["global_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '%s/bin/' | grep 'default' | grep 'global' >/dev/null" % api.TMP_PATH) == 0
|
||||
http_write_json(e)
|
||||
end
|
||||
|
||||
@@ -665,8 +665,9 @@ end
|
||||
|
||||
function server_log()
|
||||
local id = http.formvalue("id")
|
||||
if nixio.fs.access("/tmp/etc/passwall2_server/" .. id .. ".log") then
|
||||
local content = luci.sys.exec("cat /tmp/etc/passwall2_server/" .. id .. ".log")
|
||||
local f_file = api.S_TMP_PATH .. "/" .. id .. ".log"
|
||||
if nixio.fs.access(f_file) then
|
||||
local content = luci.sys.exec("cat " .. f_file)
|
||||
content = content:gsub("\n", "<br />")
|
||||
http.write(content)
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user