From: Herman van Rink Date: Mon, 17 Apr 2017 13:08:42 +0000 (+0200) Subject: Redirect additional errors to STDERR X-Git-Tag: v0.5.0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14a5f6307750f90334e41e734a24218019c3c4e3;p=thirdparty%2Fdehydrated.git Redirect additional errors to STDERR --- diff --git a/dehydrated b/dehydrated index 92bdeda..b32bdc8 100755 --- a/dehydrated +++ b/dehydrated @@ -248,18 +248,18 @@ init_system() { if [[ ! -e "${ACCOUNT_KEY}" ]]; then REAL_LICENSE="$(http_request head "${CA_TERMS}" | (grep Location: || true) | awk -F ': ' '{print $2}' | tr -d '\n\r')" if [[ -z "${REAL_LICENSE}" ]]; then - printf '\n' - printf 'Error retrieving terms of service from certificate authority.\n' - printf 'Please set LICENSE in config manually.\n' + printf '\n' >&2 + printf 'Error retrieving terms of service from certificate authority.\n' >&2 + printf 'Please set LICENSE in config manually.\n' >&2 exit 1 fi if [[ ! "${LICENSE}" = "${REAL_LICENSE}" ]]; then if [[ "${PARAM_ACCEPT_TERMS:-}" = "yes" ]]; then LICENSE="${REAL_LICENSE}" else - printf '\n' - printf 'To use dehydrated with this certificate authority you have to agree to their terms of service which you can find here: %s\n\n' "${REAL_LICENSE}" - printf 'To accept these terms of service run `%s --register --accept-terms`.\n' "${0}" + printf '\n' >&2 + printf 'To use dehydrated with this certificate authority you have to agree to their terms of service which you can find here: %s\n\n' "${REAL_LICENSE}" >&2 + printf 'To accept these terms of service run `%s --register --accept-terms`.\n' "${0}" >&2 exit 1 fi fi @@ -297,9 +297,9 @@ init_system() { fi if [[ "${FAILED}" = "true" ]]; then - echo - echo - echo "Error registering account key. See message above for more information." + echo >&2 + echo >&2 + echo "Error registering account key. See message above for more information." >&2 rm "${ACCOUNT_KEY}" "${ACCOUNT_KEY_JSON}" exit 1 fi @@ -951,7 +951,7 @@ command_sign_domains() { declare -- "${config_var}=${config_value}" ;; _) ;; - *) echo " ! Setting ${config_var} on a per-certificate base is not (yet) supported" + *) echo " ! Setting ${config_var} on a per-certificate base is not (yet) supported" >&2 esac done IFS="${ORIGIFS}"