mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
~现在跳过证书验证开关对内置下载工具也有效
This commit is contained in:
@@ -17,14 +17,22 @@ webget(){
|
||||
if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then
|
||||
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
|
||||
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
|
||||
[ "$5" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate'
|
||||
if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
|
||||
certificate=''
|
||||
else
|
||||
certificate='--no-check-certificate'
|
||||
fi
|
||||
wget -Y on $agent $progress $redirect $certificate --timeout=3 -O "$1" "$url" && return 0 #成功则退出否则重试
|
||||
wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2"
|
||||
return $?
|
||||
elif curl --version >/dev/null 2>&1; then
|
||||
[ "$3" = "echooff" ] && progress='-s' || progress='-#'
|
||||
[ "$4" = "rediroff" ] && redirect='' || redirect='-L'
|
||||
[ "$5" = "skipceroff" ] && certificate='' || certificate='-k'
|
||||
if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
|
||||
certificate=''
|
||||
else
|
||||
certificate='-k'
|
||||
fi
|
||||
if curl --version | grep -q '^curl 8.' && ckcmd base64; then
|
||||
auth_b64=$(printf '%s' "$authentication" | base64)
|
||||
result=$(curl $agent -w '%{http_code}' --connect-timeout 3 --proxy-header "Proxy-Authorization: Basic $auth_b64" $progress $redirect $certificate -o "$1" "$url")
|
||||
|
||||
Reference in New Issue
Block a user