From f481248a1835261ecd20ffc353b3bf0761d3c5e1 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sat, 2 Nov 2024 19:02:38 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BF=AE=E5=A4=8D=E4=BB=85=E8=AE=BE=E7=BD=AEi?= =?UTF-8?q?p=E5=9C=B0=E5=9D=80=E8=BF=87=E6=BB=A4=E6=97=B6=E5=B1=80?= =?UTF-8?q?=E5=9F=9F=E7=BD=91=E8=BF=87=E6=BB=A4=E5=8A=9F=E8=83=BD=E4=BE=9D?= =?UTF-8?q?=E7=84=B6=E6=98=BE=E7=A4=BA=E6=9C=AA=E5=90=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?bug=20~=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89ip=E8=A7=84=E5=88=99=E6=97=B6=EF=BC=8Csingbox=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E5=90=AF=E5=8A=A8=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20~=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89ip=E8=A7=84=E5=88=99=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/menu.sh | 2 +- scripts/start.sh | 1 + scripts/webget.sh | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/menu.sh b/scripts/menu.sh index ab90189..bb3f0ca 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -1504,7 +1504,7 @@ normal_set() { #基础设置 [ -z "$cn_ip_route" ] && cn_ip_route=未开启 [ -z "$local_proxy" ] && local_proxy=未开启 [ -z "$quic_rj" ] && quic_rj=未开启 - [ -z "$(cat ${CRASHDIR}/configs/mac)" ] && mac_return=未开启 || mac_return=已启用 + [ -z "$(cat ${CRASHDIR}/configs/mac ${CRASHDIR}/configs/ip_filter 2>/dev/null)" ] && mac_return=未开启 || mac_return=已启用 # echo ----------------------------------------------- echo -e "\033[30;47m欢迎使用功能设置菜单:\033[0m" diff --git a/scripts/start.sh b/scripts/start.sh index 490bdd9..01bbd15 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -793,6 +793,7 @@ EOF [ -n "$(grep -Ev ^# "$CRASHDIR"/yamls/rules.yaml 2>/dev/null)" ] && { cat "$CRASHDIR"/yamls/rules.yaml | sed '/#.*/d' | + sed 's/,no-resolve//g' | grep -oE '\-.*,.*,.*' | sed 's/- DOMAIN-SUFFIX,/{ "domain_suffix": [ "/g' | sed 's/- DOMAIN-KEYWORD,/{ "domain_keyword": [ "/g' | diff --git a/scripts/webget.sh b/scripts/webget.sh index c274f19..f3e6c41 100644 --- a/scripts/webget.sh +++ b/scripts/webget.sh @@ -65,7 +65,7 @@ setrules(){ #自定义规则 } del_rule_type(){ echo -e "输入对应数字即可移除相应规则:" - sed -i '/^ *$/d' $YAMLSDIR/rules.yaml + sed -i '/^ *$/d; /^#/d' $YAMLSDIR/rules.yaml cat $YAMLSDIR/rules.yaml | grep -Ev '^#' | awk -F "#" '{print " "NR" "$1$2$3}' echo ----------------------------------------------- echo -e " 0 返回上级菜单" @@ -74,9 +74,8 @@ setrules(){ #自定义规则 0) ;; '') ;; *) - text=$(cat $YAMLSDIR/rules.yaml | grep -Ev '^#' | sed -n "$num p" | awk '{print $2}') - if [ -n "$text" ];then - sed -i "/$text/d" $YAMLSDIR/rules.yaml + if [ "$num" -le "$(wc -l < $YAMLSDIR/rules.yaml)" ];then + sed -i "${num}d" $YAMLSDIR/rules.yaml sleep 1 del_rule_type else