diff --git a/scripts/clash.sh b/scripts/clash.sh index d6906bd..925ac5b 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -245,7 +245,7 @@ setport(){ setconfig host $host echo -e "\033[32m已经移除自定义host地址,请重新运行脚本以自动获取host!!!\033[0m" exit 0 - elif [ -n "$(echo $host | grep -Po '(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])(\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)){3}')" ]; then + elif [ -n "$(echo $host | grep -oE '(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])(\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)){3}')" ]; then setconfig host $host echo -e "\033[32m设置成功!!!\033[0m" else diff --git a/scripts/getdate.sh b/scripts/getdate.sh index eff8377..3a42e1b 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -279,11 +279,9 @@ clashlink(){ fi fi getlink - clashlink elif [ "$num" = 2 ];then getlink2 - clashlink elif [ "$num" = 3 ];then yamlbak=$yaml.bak @@ -328,10 +326,8 @@ clashlink(){ elif [ "$num" = 5 ];then clashcron - clashlink else errornum - clashlink fi } #下载更新相关 @@ -901,10 +897,8 @@ userguide(){ echo -e "\033[33m请先选择你的使用环境: \033[0m" echo -e "\033[0m(你之后依然可以在设置中更改各种配置)\033[0m" echo ----------------------------------------------- - echo -e " 1 \033[32m各类路由设备\033[0m,配置局域网透明路由" - echo -e " 2 \033[36m桌面版Linux系统\033[0m,仅配置本机路由" - echo -e " 3 \033[32m服务器Linux系统\033[0m,仅配置本机路由" - echo -e " 4 \033[36m多功能设备\033[0m,配置本机及局域网路由" + echo -e " 1 \033[32m主(旁)路由\033[0m" + echo -e " 2 \033[36mLinux本机代理\033[0m" echo ----------------------------------------------- read -p "请输入对应数字 > " num if [ -z "$num" ] || [ "$num" -gt 4 ];then @@ -912,14 +906,12 @@ userguide(){ forwhat elif [ "$num" = 1 ];then whichmod - elif [ "$num" = 2 -o "$num" = 3 ];then + elif [ "$num" = 2 ];then setconfig redir_mod "纯净模式" setconfig clashcore "clash" echo ----------------------------------------------- echo -e "\033[36m请选择设置本机代理的方式\033[0m" localproxy - elif [ "$num" = 4 ];then - whichmod fi } forwhat diff --git a/scripts/start.sh b/scripts/start.sh index d374fac..0e0f48f 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -170,7 +170,7 @@ EOF` else Https="" #检测节点或providers - if [ -z "$(cat $yamlnew | grep -E 'server:|proxy-providers:' | grep -v 'nameserver' | head -n 1)" ];then + if [ -z "$(cat $yamlnew | grep -E 'server|proxy-providers' | grep -v 'nameserver' | head -n 1)" ];then echo ----------------------------------------------- logger "获取到了配置文件,但似乎并不包含正确的节点信息!" 31 echo ----------------------------------------------- @@ -251,7 +251,7 @@ modify_yaml(){ mkdir -p $tmpdir > /dev/null [ "$b" != "0" ] && sed "${a},${b}d" $yaml > $tmpdir/proxy.yaml #跳过本地tls证书验证 - [ "$skip_cert" = "已开启" ] && sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/proxy.yaml + [ "$skip_cert" = "已开启" ] && sed -i '1,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/proxy.yaml #检测是否使用script规则 [ -n "$(cat $yaml | grep -E '^script:')" ] && mode='mode: Script' #添加配置