From 9f9d3c3dcb417645057ad51706c97eb3c9f43748 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sat, 12 Dec 2020 18:29:59 +0800 Subject: [PATCH] =?UTF-8?q?v1.0.0beta17.7=20~=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E5=9C=A8=E4=BD=BF=E7=94=A8=E5=8A=9F=E8=83=BD=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E9=85=8D=E7=BD=AE=E5=90=8E=E5=91=8A=E7=9F=A5?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=87=8D=E5=90=AF=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=20~=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E6=97=B6=E4=B8=8D=E4=BC=9A=E9=87=8D=E5=90=AF?= =?UTF-8?q?clash=E6=9C=8D=E5=8A=A1=E7=9A=84bug=20~=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E7=BB=93=E6=9E=84=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=83=85=E5=86=B5=E4=B8=8B=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E9=94=99=E4=B9=B1=E7=9A=84bug=20~=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8D=B8=E8=BD=BD=E6=97=B6=E4=B8=8D=E4=BC=9A=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E9=83=A8=E5=88=86=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84bug=20~=E4=BF=AE=E5=A4=8Dpac=E5=9C=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=AE=BE=E5=A4=87=E4=B8=8A=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E7=9A=84bug=EF=BC=88=E5=BE=85=E6=B5=8B=E8=AF=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/clash.sh | 13 +++++++++++++ scripts/getdate.sh | 2 ++ scripts/start.sh | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/clash.sh b/scripts/clash.sh index 4f59825..c222fda 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -122,6 +122,13 @@ clashstart(){ sleep 1 [ -n "$(pidof clash)" ] && startover } +checkrestart(){ + echo ----------------------------------------------- + echo -e "\033[32m检测到配置文件已变更,需要重启clash服务以生效!\033[0m" + echo ----------------------------------------------- + read -p "是否现在重启clash服务?(1/0) > " res + [ "$res" = 1 ] && clashstart +} #功能相关 setport(){ [ -z "$secret" ] && secret=未设置 @@ -998,7 +1005,10 @@ clashsh(){ exit; elif [ "$num" = 2 ]; then + checkcfg=$(cat $ccfg) clashcfg + checkcfg_new=$(cat $ccfg) + [ "$checkcfg" != "$checkcfg_new" ] && checkrestart clashsh elif [ "$num" = 3 ]; then @@ -1037,7 +1047,10 @@ clashsh(){ clashsh elif [ "$num" = 7 ]; then + checkcfg=$(cat $ccfg) clashadv + checkcfg_new=$(cat $ccfg) + [ "$checkcfg" != "$checkcfg_new" ] && checkrestart clashsh elif [ "$num" = 8 ]; then diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 23ca75b..0bfdb86 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -833,6 +833,8 @@ update(){ sed -i '/export clashdir=*/'d $profile sed -i '/all_proxy/'d $profile sed -i '/ALL_PROXY/'d $profile + cronset "clash服务" + cronset "订阅链接" echo ----------------------------------------------- echo -e "\033[36m已卸载ShellClash相关文件!有缘再会!\033[0m" echo -e "\033[33m请手动关闭当前窗口以重置环境变量!\033[0m" diff --git a/scripts/start.sh b/scripts/start.sh index 495703d..c10370f 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -472,7 +472,7 @@ function FindProxyForURL(url, host) { ) return "DIRECT"; else - return "SOCKS5 $host:$mix_port; PROXY $host:$mix_port; DIRECT;" + return "PROXY 192.168.31.1:7890; DIRECT; SOCKS5 192.168.31.1:7890" } EOF compare /tmp/clash_pac $bindir/ui/pac