v1.3.6-test
~增加了对生成配置文件时指定clash为文件头的功能 ~使用在线生成配置时,强制使用dler.io作为dler的api地址
This commit is contained in:
@@ -5,21 +5,23 @@ webget(){
|
||||
[ -n "$(pidof clash)" ] && export all_proxy="http://$authentication@127.0.0.1:$mix_port" #设置临时http代理
|
||||
#参数【$1】代表下载目录,【$2】代表在线地址
|
||||
#参数【$3】代表输出显示,【$4】不启用重定向
|
||||
#参数【$5】代表验证证书
|
||||
#参数【$5】代表验证证书,【$6】使用clash文件头
|
||||
if curl --version > /dev/null 2>&1;then
|
||||
[ "$3" = "echooff" ] && progress='-s' || progress='-#'
|
||||
[ "$4" = "rediroff" ] && redirect='' || redirect='-L'
|
||||
[ "$5" = "skipceroff" ] && certificate='' || certificate='-k'
|
||||
result=$(curl -w %{http_code} --connect-timeout 3 $progress $redirect $certificate -o $1 $2)
|
||||
[ -n "$6" ] && agent='-A "clash"'
|
||||
result=$(curl $agent -w %{http_code} --connect-timeout 3 $progress $redirect $certificate -o $1 $2)
|
||||
[ "$result" != "200" ] && export all_proxy="" && result=$(curl -w %{http_code} --connect-timeout 3 $progress $redirect $certificate -o $1 $2)
|
||||
else
|
||||
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
|
||||
[ "$3" = "echoon" ] && progress=''
|
||||
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
|
||||
[ "$5" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate'
|
||||
wget -Y on $progress $redirect $certificate --timeout=3 -O $1 $2
|
||||
[ -n "$6" ] && agent='--user-agent="clash"'
|
||||
wget -Y on $agent $progress $redirect $certificate --timeout=3 -O $1 $2
|
||||
if [ "$?" != "0" ];then
|
||||
wget $progress $redirect $certificate --timeout=3 -O $1 $2
|
||||
wget $agent $progress $redirect $certificate --timeout=3 -O $1 $2
|
||||
[ "$?" = "0" ] && result="200"
|
||||
else
|
||||
result="200"
|
||||
|
||||
Reference in New Issue
Block a user