diff --git a/scripts/libs/web_get.sh b/scripts/libs/web_get.sh index 51ccb5df..d3c33b6b 100644 --- a/scripts/libs/web_get.sh +++ b/scripts/libs/web_get.sh @@ -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")