mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-04 22:33:56 +08:00
update 2026-05-22 01:53:55
This commit is contained in:
1 parent
cafaac05d2
commit
533dbc85c9
4 files changed
+15
-5
No files matched your search
@@ -1423,11 +1423,12 @@ function act_reset()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function act_restart()
|
function act_restart()
|
||||||
|
luci.sys.call("/etc/init.d/shadowsocksr restart > /dev/null 2>&1 &")
|
||||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr"))
|
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function act_delete()
|
function act_delete()
|
||||||
luci.sys.call("/etc/init.d/shadowsocksr restart &")
|
luci.sys.call("/etc/init.d/shadowsocksr restart > /dev/null 2>&1 &")
|
||||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
|
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ luci.http.setfilehandler(function(meta, chunk, eof)
|
|||||||
luci.sys.call("rm -rf " .. temp_dir)
|
luci.sys.call("rm -rf " .. temp_dir)
|
||||||
nixio.fs.remove(file_path)
|
nixio.fs.remove(file_path)
|
||||||
fd = nixio.open(file_path, "w")
|
fd = nixio.open(file_path, "w")
|
||||||
|
luci.sys.call("ls /tmp/sub_md5_* >/dev/null 2>&1 && rm -f /tmp/sub_md5_*")
|
||||||
luci.sys.call("echo '' > /var/log/ssrplus.log")
|
luci.sys.call("echo '' > /var/log/ssrplus.log")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ luci.http.setfilehandler(function(meta, chunk, eof)
|
|||||||
-- 清理临时文件
|
-- 清理临时文件
|
||||||
luci.sys.call("rm -rf " .. temp_dir)
|
luci.sys.call("rm -rf " .. temp_dir)
|
||||||
nixio.fs.remove(file_path)
|
nixio.fs.remove(file_path)
|
||||||
|
luci.sys.call("ls /tmp/sub_md5_* >/dev/null 2>&1 && rm -f /tmp/sub_md5_*")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -719,9 +719,9 @@ node.render = function(self, section, scope)
|
|||||||
Button.render(self, section, scope)
|
Button.render(self, section, scope)
|
||||||
end
|
end
|
||||||
node.write = function(self, section)
|
node.write = function(self, section)
|
||||||
uci:set("shadowsocksr", '@global[0]', 'global_server', section)
|
local safe_section = luci.util.shellquote(section)
|
||||||
uci:save("shadowsocksr")
|
local cmd = string.format("uci set shadowsocksr.@global[0].global_server=%s && uci commit shadowsocksr", safe_section)
|
||||||
uci:commit("shadowsocksr")
|
luci.sys.call(cmd)
|
||||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "restart"))
|
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "restart"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -534,7 +534,14 @@ function import_ssr_url(btn, urlname, sid) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalSSBackend = preferredSSBackend();
|
let finalSSBackend;
|
||||||
|
const finalXray = (params.security && params.security !== "none") || // TLS/XTLS/Reality
|
||||||
|
(params.type && ["ws", "httpupgrade", "xhttp", "splithttp", "grpc", "quic", "kcp", "http", "h2"].includes(params.type));
|
||||||
|
if (finalXray && has_xray === "true") {
|
||||||
|
finalSSBackend = "v2ray";
|
||||||
|
} else {
|
||||||
|
finalSSBackend = preferredSSBackend();
|
||||||
|
}
|
||||||
if (finalSSBackend === null) {
|
if (finalSSBackend === null) {
|
||||||
s.innerHTML = "<font style=\'color:red\'><%:No available core (Shadowsocks or Xray) to import this node.%></font>";
|
s.innerHTML = "<font style=\'color:red\'><%:No available core (Shadowsocks or Xray) to import this node.%></font>";
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in new issue
Block a user