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