mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
fix some brook issue
This commit is contained in:
parent
643e9a399f
commit
e1aeab75d6
@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Brook
|
||||
LUCI_DEPENDS:=+iptables-mod-tproxy +kmod-ipt-tproxy +ip +ipset-lists +brook +pdnsd-alt +coreutils +coreutils-base64 +coreutils-nohup +dnsmasq-full
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
ssr_enable=$(uci get shadowsocksr.@shadowsocksr[0].enabled 2>/dev/null)
|
||||
brook_enable=$(uci get brook.@brook[0].enabled 2>/dev/null)
|
||||
|
||||
if [ $ssr_enable -eq 1 ]; then
|
||||
if pidof ssr-redir>/dev/null; then
|
||||
/etc/init.d/ssrpro reload
|
||||
if [ $brook_enable -eq 1 ]; then
|
||||
if pidof brook>/dev/null; then
|
||||
/etc/init.d/brookpro reload
|
||||
else
|
||||
/etc/init.d/ssrpro restart
|
||||
/etc/init.d/brookpro restart
|
||||
fi
|
||||
fi
|
||||
|
@ -10,12 +10,12 @@ LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
/usr/bin/wget --spider --quiet --tries=1 --timeout=3 www.gstatic.com/generate_204
|
||||
|
||||
if [ "$?" == "0" ]; then
|
||||
echo '['$LOGTIME'] ShadowsocksR No Problem.'
|
||||
echo '['$LOGTIME'] Brook No Problem.'
|
||||
else
|
||||
/usr/bin/wget --spider --quiet --tries=1 --timeout=3 www.baidu.com
|
||||
if [ "$?" == "0" ]; then
|
||||
echo '['$LOGTIME'] Problem decteted, restarting ShadowsocksR...'
|
||||
/etc/init.d/ssrpro restart
|
||||
echo '['$LOGTIME'] Problem decteted, restarting Brook...'
|
||||
/etc/init.d/brookpro restart
|
||||
else
|
||||
echo '['$LOGTIME'] Network Problem. Do nothing.'
|
||||
fi
|
||||
|
@ -5,9 +5,8 @@
|
||||
START=99
|
||||
|
||||
SS_REDIR_PORT=7070
|
||||
SS_REDIR_PIDFILE=/var/run/ssr-redir-go.pid
|
||||
SS_REDIR_PIDFILE=/var/run/brook-go.pid
|
||||
PDNSD_LOCAL_PORT=7453
|
||||
SSRCONF=/etc/brook.json
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
CONFIG=brook
|
||||
|
||||
@ -58,12 +57,12 @@ start()
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
if [ "$vt_enabled" = 0 ]; then
|
||||
echo "WARNING: brook is disabled."
|
||||
echo "WARNING: Brook is disabled."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$vt_server_addr" -o -z "$vt_server_port" ]; then
|
||||
echo "WARNING: brook not fully configured, not starting."
|
||||
echo "WARNING: Brook not fully configured, not starting."
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.shadowsocksr
|
||||
set firewall.shadowsocksr=include
|
||||
set firewall.shadowsocksr.type=script
|
||||
set firewall.shadowsocksr.path=/etc/shadowsocksr.include
|
||||
set firewall.shadowsocksr.reload=1
|
||||
delete firewall.brook
|
||||
set firewall.brook=include
|
||||
set firewall.brook.type=script
|
||||
set firewall.brook.path=/etc/brook.include
|
||||
set firewall.brook.reload=1
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
/etc/init.d/shadowsocksr stop
|
||||
/etc/init.d/shadowsocksr disable
|
||||
/etc/init.d/brookpro stop
|
||||
/etc/init.d/brookpro disable
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user