From fd267e6316ec2d097c3ddd30965f97e6b3cf3d80 Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 13 Oct 2020 17:24:29 +0800 Subject: [PATCH] =?UTF-8?q?v1.0.0beta14fix4=20~=E4=BC=98=E5=8C=96=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E4=BF=9D=E5=AD=98=E6=96=B9=E5=BC=8F=EF=BC=8C=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E6=AF=8F10=E5=88=86=E9=92=9F=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=EF=BC=8C=E4=BB=85=E5=9C=A8=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=88=B0=E6=96=87=E4=BB=B6=E5=8F=98=E5=8A=A8=E5=90=8E=E6=96=B9?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BF=9D=E5=AD=98=20~=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86ssr=E8=8A=82=E7=82=B9=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E7=9A=84bug=20~mac=E8=BF=87=E6=BB=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=A2=9E=E5=8A=A0=E7=A7=BB=E9=99=A4=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BB=A5=E5=8F=8A=E6=B7=BB=E5=8A=A0=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E8=AE=BE=E5=A4=87=E5=8A=9F=E8=83=BD=20~=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AE=BE=E7=BD=AE=E6=9C=AC=E6=9C=BA=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=97=B6=E7=9B=B4=E6=8E=A5=E8=B7=B3=E5=87=BA=E7=9A=84bug=20~?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0root=E7=94=A8=E6=88=B7=E6=A3=80=E6=B5=8B=20~?= =?UTF-8?q?=E4=BC=98=E5=8C=96ipv6dns=E6=8B=A6=E6=88=AA=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=20~=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=BC=80=E6=9C=BA=E5=90=AF=E5=8A=A8=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E7=9A=84bug=20~=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=AE=BE=E5=A4=87=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index e5c382a..3cc67c9 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -288,7 +288,13 @@ daemon(){ } web_save(){ #使用curl获取面板节点设置 - curl -s -H "Authorization: Bearer ${secret}" -H "Content-Type:application/json" http://localhost:${db_port}/proxies | awk -F "{" '{for(i=1;i<=NF;i++) print $i}' | grep -E '^"all".*"Selector"' | grep -oE '"name".*"now".*",' | sed 's/"name"://g' | sed 's/"now"://g'| sed 's/"//g' > $clashdir/web_save + curl -s -H "Authorization: Bearer ${secret}" -H "Content-Type:application/json" http://localhost:${db_port}/proxies | awk -F "{" '{for(i=1;i<=NF;i++) print $i}' | grep -E '^"all".*"Selector"' | grep -oE '"name".*"now".*",' | sed 's/"name"://g' | sed 's/"now"://g'| sed 's/"//g' > /tmp/clash_web_save + #对比文件,如果有变动则写入磁盘,否则清除缓存 + if [ "$(cat /tmp/clash_web_save)" = "$(cat $clashdir/web_save 2>/dev/null)" ];then + rm -rf /tmp/clash_web_save + else + mv -f /tmp/clash_web_save $clashdir/web_save + fi } web_restore(){ #设置循环检测clash面板端口 @@ -311,7 +317,7 @@ web_restore(){ web_save_auto(){ if [ -n "$cronpath" ];then if [ -z "$(cat $cronpath | grep '保存节点配置')" ];then - echo '* */1 * * * test -n "$(pidof clash)" && /etc/init.d/clash web_save #每小时保存节点配置' >> $cronpath + echo '*/10 * * * * test -n "$(pidof clash)" && /etc/init.d/clash web_save #每10分钟保存节点配置' >> $cronpath chmod 600 $cronpath fi else