Merge pull request #479 from RikudouPatrickstar/patch-1

更新 web_save 适配 clash meta 1.5.1 报文格式
This commit is contained in:
juewuy 2023-09-08 09:16:09 +08:00 committed by GitHub
commit 08cafce182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1043,7 +1043,7 @@ stop_firewall(){
#面板配置保存相关
web_save(){
#使用get_save获取面板节点设置
get_save http://127.0.0.1:${db_port}/proxies | awk -F ':\\{"' '{for(i=1;i<=NF;i++) print $i}' | grep -aE '^all".*"Selector"' > $TMPDIR/clash_web_check_$USER
get_save http://127.0.0.1:${db_port}/proxies | awk -F ':\\{"' '{for(i=1;i<=NF;i++) print $i}' | grep -aE '(^all|^alive)".*"Selector"' > $TMPDIR/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/"type":.*//g' | sed 's/,//g')