mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-08 05:04:21 +08:00
💋 Sync 2026-10-16 23:55:30
This commit is contained in:
1 parent
76f10c2a74
commit
1849cc6156
254 files changed
+25484
-8840
No files matched your search
@@ -178,9 +178,11 @@ function get_cache_var(key)
|
||||
return val
|
||||
end
|
||||
|
||||
function get_new_port()
|
||||
local cmd_format = ". /usr/share/passwall/utils.sh ; echo -n $(get_new_port %s tcp,udp)"
|
||||
return tonumber(sys.exec(string.format(cmd_format, "auto")))
|
||||
function get_new_port(start_port, protocol)
|
||||
start_port = tonumber(start_port) or "auto"
|
||||
if protocol ~= "tcp" and protocol ~= "udp" then protocol = "tcp,udp" end
|
||||
local cmd_format = ". /usr/share/passwall/utils.sh ; echo -n $(get_new_port %s %s)"
|
||||
return tonumber(sys.exec(string.format(cmd_format, util.shellquote(tostring(start_port)), util.shellquote(protocol))))
|
||||
end
|
||||
|
||||
function exec_call(cmd)
|
||||
|
||||
Reference in new issue
Block a user