mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 12:33:56 +08:00
update 2026-09-13 16:42:22
This commit is contained in:
1 parent
2e55e363ac
commit
141863e6d4
1977 files changed
+359
-1523334
No files matched your search
@@ -192,12 +192,16 @@ function sh_uci_commit(config)
|
||||
exec_call(string.format("uci -q commit %s", config))
|
||||
end
|
||||
|
||||
function del_cache_var(key)
|
||||
sys.call(string.format('. /usr/share/passwall2/utils.sh ; del_cache_var "%s"', key))
|
||||
end
|
||||
|
||||
function set_cache_var(key, val)
|
||||
sys.call(string.format('. /usr/share/passwall2/utils.sh ; set_cache_var %s "%s"', key, val))
|
||||
sys.call(string.format('. /usr/share/passwall2/utils.sh ; set_cache_var "%s" "%s"', key, val))
|
||||
end
|
||||
|
||||
function get_cache_var(key)
|
||||
local val = sys.exec(string.format('. /usr/share/passwall2/utils.sh ; echo -n $(get_cache_var %s)', key))
|
||||
local val = sys.exec(string.format('. /usr/share/passwall2/utils.sh ; echo -n $(get_cache_var "%s")', key))
|
||||
if val == "" then val = nil end
|
||||
return val
|
||||
end
|
||||
@@ -2054,3 +2058,11 @@ function parseDNS(dns)
|
||||
end
|
||||
return dns, 53
|
||||
end
|
||||
|
||||
function get_socks_port_by_cache(node_id)
|
||||
return get_cache_var("node_%s_socks_port" % { node_id })
|
||||
end
|
||||
|
||||
function set_socks_port_to_cache(node_id, v)
|
||||
set_cache_var("node_%s_socks_port" % { node_id }, v)
|
||||
end
|
||||
Reference in new issue
Block a user