~修复仅设置ip地址过滤时局域网过滤功能依然显示未启用的bug

~修复使用自定义ip规则时,singbox内核启动报错的问题
~修复删除自定义ip规则时的报错问题
This commit is contained in:
juewuy 2024-11-02 19:02:38 +08:00
parent 4d84fdaaff
commit f481248a18
3 changed files with 5 additions and 5 deletions

View File

@ -1504,7 +1504,7 @@ normal_set() { #基础设置
[ -z "$cn_ip_route" ] && cn_ip_route=未开启 [ -z "$cn_ip_route" ] && cn_ip_route=未开启
[ -z "$local_proxy" ] && local_proxy=未开启 [ -z "$local_proxy" ] && local_proxy=未开启
[ -z "$quic_rj" ] && quic_rj=未开启 [ -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 -----------------------------------------------
echo -e "\033[30;47m欢迎使用功能设置菜单\033[0m" echo -e "\033[30;47m欢迎使用功能设置菜单\033[0m"

View File

@ -793,6 +793,7 @@ EOF
[ -n "$(grep -Ev ^# "$CRASHDIR"/yamls/rules.yaml 2>/dev/null)" ] && { [ -n "$(grep -Ev ^# "$CRASHDIR"/yamls/rules.yaml 2>/dev/null)" ] && {
cat "$CRASHDIR"/yamls/rules.yaml | cat "$CRASHDIR"/yamls/rules.yaml |
sed '/#.*/d' | sed '/#.*/d' |
sed 's/,no-resolve//g' |
grep -oE '\-.*,.*,.*' | grep -oE '\-.*,.*,.*' |
sed 's/- DOMAIN-SUFFIX,/{ "domain_suffix": [ "/g' | sed 's/- DOMAIN-SUFFIX,/{ "domain_suffix": [ "/g' |
sed 's/- DOMAIN-KEYWORD,/{ "domain_keyword": [ "/g' | sed 's/- DOMAIN-KEYWORD,/{ "domain_keyword": [ "/g' |

View File

@ -65,7 +65,7 @@ setrules(){ #自定义规则
} }
del_rule_type(){ del_rule_type(){
echo -e "输入对应数字即可移除相应规则:" 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}' cat $YAMLSDIR/rules.yaml | grep -Ev '^#' | awk -F "#" '{print " "NR" "$1$2$3}'
echo ----------------------------------------------- echo -----------------------------------------------
echo -e " 0 返回上级菜单" echo -e " 0 返回上级菜单"
@ -74,9 +74,8 @@ setrules(){ #自定义规则
0) ;; 0) ;;
'') ;; '') ;;
*) *)
text=$(cat $YAMLSDIR/rules.yaml | grep -Ev '^#' | sed -n "$num p" | awk '{print $2}') if [ "$num" -le "$(wc -l < $YAMLSDIR/rules.yaml)" ];then
if [ -n "$text" ];then sed -i "${num}d" $YAMLSDIR/rules.yaml
sed -i "/$text/d" $YAMLSDIR/rules.yaml
sleep 1 sleep 1
del_rule_type del_rule_type
else else