Fix the bug of URL check failure and fix the bug of download failure

This commit is contained in:
wanhebin 2022-03-14 22:24:44 +08:00
parent 88468907db
commit d4b7e6be6d

View File

@ -47,8 +47,7 @@ URL='更改为你的clash订阅地址'
# 检查url是否有效 # 检查url是否有效
Text1="Clash订阅地址可访问" Text1="Clash订阅地址可访问"
Text2="Clash订阅地址不可访问" Text2="Clash订阅地址不可访问"
# curl -s --head $URL | head -n 1 | grep 'HTTP/1.[01] [23]..' > /dev/null curl -s --head $URL | head -n 1 | grep 'HTTP/1.[01] [23]..' > /dev/null
wget -q -O /dev/null $URL
if_success $Text1 $Text2 if_success $Text1 $Text2
# 临时取消环境变量 # 临时取消环境变量
@ -59,7 +58,8 @@ unset no_proxy
# 拉取更新config.yml文件 # 拉取更新config.yml文件
Text3="配置文件config.yaml下载成功" Text3="配置文件config.yaml下载成功"
Text4="配置文件config.yaml下载失败退出启动" Text4="配置文件config.yaml下载失败退出启动"
wget -q -O $Temp_Dir/clash.yaml $URL #wget -q -O $Temp_Dir/clash.yaml $URL
curl -s -o $Temp_Dir/clash.yaml $URL
if_success $Text3 $Text4 if_success $Text3 $Text4
# 取出代理相关配置 # 取出代理相关配置