add del all servers function in ssr plus

This commit is contained in:
coolsnowwolf 2018-10-23 19:30:57 +08:00
parent 247e2c5986
commit c15e4e9017
4 changed files with 21 additions and 1 deletions

View File

@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for SSR Plus
LUCI_DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=27
PKG_RELEASE:=28
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -37,6 +37,13 @@ o.write = function()
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
end
o = s:option(Button,"delete",translate("Delete all severs"))
o.inputstyle = "reset"
o.write = function()
luci.sys.call("nohup bash /usr/share/shadowsocksr/delservers.sh > /tmp/subupdate.log 2>&1 &")
luci.sys.call("sleep 3")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
end
-- [[ Servers Manage ]]--
s = m:section(TypedSection, "servers")

View File

@ -451,3 +451,7 @@ msgstr "游戏模式UDP中继"
msgid "Server failsafe auto swith settings"
msgstr "服务器节点故障自动切换设置"
msgid "Delete all severs"
msgstr "删除所有服务器"

View File

@ -0,0 +1,9 @@
#!/bin/bash
for((i=1;i<=200;i++));
do
uci delete shadowsocksr.@servers[$1] >/dev/null 2>&1
done
uci commit shadowsocksr
/etc/init.d/shadowsocksr stop