From 5924a3ecf766e6d6e6495e372dcbfe89f9c9fe97 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 13 Dec 2020 13:57:37 +0800 Subject: [PATCH] =?UTF-8?q?v1.0.0beta17.8=20~=E4=BC=98=E5=8C=96=E4=BA=86?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=8A=82=E7=82=B9=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=8C=E8=8A=82=E7=9C=81=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E6=B6=88=E8=80=97=20~=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=83=85=E5=86=B5=E4=B8=8B=E8=AE=A2=E9=98=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5/=E9=85=8D=E7=BD=AE=E9=93=BE=E6=8E=A5=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index c10370f..4bb14c6 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -420,7 +420,13 @@ web_save(){ fi } #使用get_save获取面板节点设置 - get_save 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_$USER + #get_save 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_$USER + get_save http://localhost:${db_port}/proxies | awk -F "{" '{for(i=1;i<=NF;i++) print $i}' | grep -E '^"all".*"Selector"' > /tmp/clash_web_check_$USER + while read line ;do + def=$(echo $line | awk -F "[\[,]" '{print $2}') + now=$(echo $line | grep -oE '"now".*",' | sed 's/"now"://g'| sed 's/,//g') + [ "$def" != "$now" ] && echo $line | grep -oE '"name".*"now".*",' | sed 's/"name"://g' | sed 's/"now"://g'| sed 's/"//g' >> /tmp/clash_web_save_$USER + done < /tmp/clash_web_check_$USER #对比文件,如果有变动且不为空则写入磁盘,否则清除缓存 [ ! -s /tmp/clash_web_save_$USER ] && compare /tmp/clash_web_save_$USER $clashdir/web_save [ "$?" = 0 ] && rm -rf /tmp/clash_web_save_$USER || mv -f /tmp/clash_web_save_$USER $clashdir/web_save