mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-11 10:42:04 +08: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_DEPENDS:=+iptables-mod-tproxy +kmod-ipt-tproxy +ip +ipset-lists +brook +pdnsd-alt +coreutils +coreutils-base64 +coreutils-nohup +dnsmasq-full
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_VERSION:=1.0
|
PKG_VERSION:=1.0
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/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 [ $brook_enable -eq 1 ]; then
|
||||||
if pidof ssr-redir>/dev/null; then
|
if pidof brook>/dev/null; then
|
||||||
/etc/init.d/ssrpro reload
|
/etc/init.d/brookpro reload
|
||||||
else
|
else
|
||||||
/etc/init.d/ssrpro restart
|
/etc/init.d/brookpro restart
|
||||||
fi
|
fi
|
||||||
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
|
/usr/bin/wget --spider --quiet --tries=1 --timeout=3 www.gstatic.com/generate_204
|
||||||
|
|
||||||
if [ "$?" == "0" ]; then
|
if [ "$?" == "0" ]; then
|
||||||
echo '['$LOGTIME'] ShadowsocksR No Problem.'
|
echo '['$LOGTIME'] Brook No Problem.'
|
||||||
else
|
else
|
||||||
/usr/bin/wget --spider --quiet --tries=1 --timeout=3 www.baidu.com
|
/usr/bin/wget --spider --quiet --tries=1 --timeout=3 www.baidu.com
|
||||||
if [ "$?" == "0" ]; then
|
if [ "$?" == "0" ]; then
|
||||||
echo '['$LOGTIME'] Problem decteted, restarting ShadowsocksR...'
|
echo '['$LOGTIME'] Problem decteted, restarting Brook...'
|
||||||
/etc/init.d/ssrpro restart
|
/etc/init.d/brookpro restart
|
||||||
else
|
else
|
||||||
echo '['$LOGTIME'] Network Problem. Do nothing.'
|
echo '['$LOGTIME'] Network Problem. Do nothing.'
|
||||||
fi
|
fi
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
START=99
|
START=99
|
||||||
|
|
||||||
SS_REDIR_PORT=7070
|
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
|
PDNSD_LOCAL_PORT=7453
|
||||||
SSRCONF=/etc/brook.json
|
|
||||||
CRON_FILE=/etc/crontabs/root
|
CRON_FILE=/etc/crontabs/root
|
||||||
CONFIG=brook
|
CONFIG=brook
|
||||||
|
|
||||||
@ -58,12 +57,12 @@ start()
|
|||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
if [ "$vt_enabled" = 0 ]; then
|
if [ "$vt_enabled" = 0 ]; then
|
||||||
echo "WARNING: brook is disabled."
|
echo "WARNING: Brook is disabled."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$vt_server_addr" -o -z "$vt_server_port" ]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete firewall.shadowsocksr
|
delete firewall.brook
|
||||||
set firewall.shadowsocksr=include
|
set firewall.brook=include
|
||||||
set firewall.shadowsocksr.type=script
|
set firewall.brook.type=script
|
||||||
set firewall.shadowsocksr.path=/etc/shadowsocksr.include
|
set firewall.brook.path=/etc/brook.include
|
||||||
set firewall.shadowsocksr.reload=1
|
set firewall.brook.reload=1
|
||||||
commit firewall
|
commit firewall
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
/etc/init.d/shadowsocksr stop
|
/etc/init.d/brookpro stop
|
||||||
/etc/init.d/shadowsocksr disable
|
/etc/init.d/brookpro disable
|
||||||
|
|
||||||
rm -f /tmp/luci-indexcache
|
rm -f /tmp/luci-indexcache
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user