luci-app-ssr-plus: update cron sh

This commit is contained in:
lean 2020-03-16 13:53:28 +08:00
parent c4d78537ee
commit 1b5a015c96
5 changed files with 17 additions and 13 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=167
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -70,8 +70,7 @@ uci:delete_all("shadowsocksr", "servers", function(s)
end)
uci:save("shadowsocksr")
uci:commit("shadowsocksr")
luci.sys.init.stop("shadowsocksr")
luci.sys.init.start("shadowsocksr")
luci.sys.exec("/etc/init.d/shadowsocksr restart")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
return
end
@ -115,14 +114,13 @@ o.template="shadowsocksr/ping"
o.width="10%"
o = s:option(Button,"apply_node",translate("Apply"))
o.inputstyle = "apply"
o.write = function(self, section)
node = s:option(Button,"apply_node",translate("Apply"))
node.inputstyle = "apply"
node.write = function(self, section)
ucic:set("shadowsocksr", '@global[0]', 'global_server', section)
ucic:save("shadowsocksr")
ucic:commit("shadowsocksr")
luci.sys.init.stop("shadowsocksr")
luci.sys.init.start("shadowsocksr")
luci.sys.exec("/etc/init.d/shadowsocksr restart")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "client"))
end
@ -134,4 +132,4 @@ end
m:append(Template("shadowsocksr/server_list"))
return m
return m

View File

@ -49,8 +49,8 @@ uci_get_by_cfgid() {
add_cron() {
sed -i '/shadowsocksr/d' $CRON_FILE
sed -i '/ssrplus.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/ssrplus.log' >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/bin/lua /usr/share/shadowsocksr/subscribe.lua" >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 5 * * * /usr/bin/lua /usr/share/shadowsocksr/update.lua" >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/share/shadowsocksr/ssrplusupdate.sh" >>$CRON_FILE
crontab $CRON_FILE
}
@ -197,7 +197,7 @@ start_rules() {
if [ $dports == "1" ]; then
proxyport=" "
else
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443,5222"
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443"
fi
/usr/bin/ssr-rules \
-s "$server" \

View File

@ -0,0 +1,6 @@
#!/bin/sh
/usr/bin/lua /usr/share/shadowsocksr/update.lua
/usr/bin/lua /usr/share/shadowsocksr/subscribe.lua
sleep 10
/etc/init.d/shadowsocksr restart

View File

@ -94,4 +94,4 @@ else
end
end
luci.sys.call("/etc/init.d/dnsmasq restart")
luci.sys.call("/etc/init.d/dnsmasq reload")