~修复仅设置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

@@ -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