Browse Source

Move test to bottom and switched from $? to $ret

I could refactor the if/else logic to provide curl|wget in the debug message, but wanted to keep the change simple to hopefully get pulled.
pull/158/head
David Mcanulty 9 years ago
parent
commit
011d39ae23
  1. 9
      acme.sh

9
acme.sh

@ -520,14 +520,8 @@ _get() {
if _exists "curl" ; then if _exists "curl" ; then
if [ "$onlyheader" ] ; then if [ "$onlyheader" ] ; then
$CURL -I -A "User-Agent: $USER_AGENT" $url $CURL -I -A "User-Agent: $USER_AGENT" $url
if [ $? -gt 0 ] ;then
_err "Curl failed with exit code $?, trying running script with --debug 2"
fi
else else
$CURL -A "User-Agent: $USER_AGENT" $url $CURL -A "User-Agent: $USER_AGENT" $url
if [ $? -gt 0 ] ;then
_err "Curl failed with exit code $?, trying running script with --debug 2"
fi
fi fi
else else
_debug "WGET" "$WGET" _debug "WGET" "$WGET"
@ -538,6 +532,9 @@ _get() {
fi fi
fi fi
ret=$? ret=$?
if [ $ret -gt 0 ] ;then
_err "URL get failed with exit code $ret, trying running script with --debug 2"
fi
return $ret return $ret
} }

Loading…
Cancel
Save