271
271
# 2021-08-26 Improve upgrade check & make upgrade do a full install when possible (tlhackque) (#694) (2.42)
272
272
# 2021-09-02 Fix version compare - cURL v8 may have single digit minor numbers. (tlhackque) (2.43)
273
273
# 2021-09-26 Delete key file when key algorithm has changed (makuhama)
274
+ # 2021-09-30 better error if curl returns 60 (#709)
275
+ # 2021-10-01 Fix -preferred-chain argument (#712)
276
+ # 2021-10-01 Show help if no domain specified (#705)(2.44)
274
277
# ----------------------------------------------------------------------------------------
275
278
276
279
case :$SHELLOPTS : in
279
282
280
283
PROGNAME=${0##*/ }
281
284
PROGDIR=" $( cd " $( dirname " $0 " ) " || exit ; pwd -P; ) "
282
- VERSION=" 2.43 "
285
+ VERSION=" 2.44 "
283
286
284
287
# defaults
285
288
ACCOUNT_KEY_LENGTH=4096
@@ -290,7 +293,7 @@ CHALLENGE_CHECK_TYPE="http"
290
293
CHECK_REMOTE_WAIT=0
291
294
CHECK_REMOTE=" true"
292
295
if [[ -n " ${GITHUB_REPOSITORY} " ]] ; then
293
- CODE_LOCATION=" https://raw.githubusercontent.com/${GITHUB_REPOSITORY} /getssl/ master/getssl"
296
+ CODE_LOCATION=" https://raw.githubusercontent.com/${GITHUB_REPOSITORY} /master/getssl"
294
297
RELEASE_API=" https://api.github.com/repos/${GITHUB_REPOSITORY} /releases/latest"
295
298
else
296
299
CODE_LOCATION=" https://raw.githubusercontent.com/srvrco/getssl/master/getssl"
@@ -784,7 +787,7 @@ check_getssl_upgrade() { # check if a more recent release is available
784
787
# Replace error in release description with _error (which is ignored by check_output_for_errors() in the tests)
785
788
debug " ${release_data// error/ _error} "
786
789
release_data=" $( sed -e' s/^ *//g' <<< " ${release_data}" ) "
787
- release_tag=" $( sed -e' /^ "tag_name": *"/!d;s/^ "tag_name": *"\([^""]*\).*$/\1/' <<< " ${release_data}" ) "
790
+ release_tag=" $( sed -e' /"tag_name": *"/!d;s/"tag_name": *"\([^""]*\).*$/\1/' <<< " ${release_data}" ) "
788
791
if [[ " ${release_tag: 0: 1} " != ' v' ]] ; then
789
792
if [[ ${_MUTE} -eq 0 ]]; then
790
793
info " The current repository has no releases or is improperly tagged; can't check for upgrades: '$release_tag '"
@@ -820,7 +823,7 @@ check_getssl_upgrade() { # check if a more recent release is available
820
823
if [ " $TEMP_UPGRADE_FILE " == " " ]; then
821
824
error_exit " mktemp failed"
822
825
fi
823
- CODE_LOCATION=$( sed -e" s/getssl\/ master/${release_tag} /" <<< " $CODE_LOCATION" )
826
+ CODE_LOCATION=$( sed -e" s/master/${release_tag} /" <<< " $CODE_LOCATION" )
824
827
# shellcheck disable=SC2086
825
828
debug curl ${_NOMETER:- --silent} --user-agent " $CURL_USERAGENT " " $CODE_LOCATION " --output " $TEMP_UPGRADE_FILE "
826
829
# shellcheck disable=SC2086
@@ -2427,7 +2430,7 @@ send_signed_request() { # Sends a request to the ACME server, signed with your p
2427
2430
fi
2428
2431
debug " response status = $response_status "
2429
2432
if [[ " $code " -eq 500 ]]; then
2430
- info " error on acme server - trying again ...."
2433
+ info " _error on acme server - trying again ...."
2431
2434
debug " loop_limit = $loop_limit "
2432
2435
sleep 5
2433
2436
loop_limit=$(( loop_limit - 1 ))
@@ -2755,7 +2758,7 @@ while [[ -n ${1+defined} ]]; do
2755
2758
_ONLY_CHECK_CONFIG=1 ;;
2756
2759
-w)
2757
2760
shift ; WORKING_DIR=" $1 " ;;
2758
- -preferred-chain)
2761
+ -preferred-chain | --preferred-chain )
2759
2762
shift ; PREFERRED_CHAIN=" $1 " ;;
2760
2763
--source)
2761
2764
return ;;
@@ -2830,6 +2833,10 @@ if [[ $_UPGRADE_CHECK -eq 1 ]]; then
2830
2833
# if nothing in command line and no revocation and not only config check,
2831
2834
# then exit after upgrade
2832
2835
if [[ -z " $DOMAIN " ]] && [[ ${_CHECK_ALL} -ne 1 ]] && [[ ${_REVOKE} -ne 1 ]] && [ " ${_ONLY_CHECK_CONFIG} " -ne 1 ]; then
2836
+ # if nothing in command line, print help before exit.
2837
+ if [[ -z " $DOMAIN " ]] && [[ ${_CHECK_ALL} -ne 1 ]]; then
2838
+ help_message
2839
+ fi
2833
2840
graceful_exit
2834
2841
fi
2835
2842
fi
0 commit comments