mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 03:32:34 +08:00
v1.3.3
~修复指定本机host时报错的bug ~新手引导说明调整及bug修复 ~修复跳过证书验证功能相关bug ~修复检测配置文件节点相关bug
This commit is contained in:
parent
80c2a551d0
commit
0e9ef74727
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
#添加配置
|
||||
|
|
Loading…
Reference in New Issue
Block a user