]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
Redirect additional errors to STDERR
authorHerman van Rink <rink@initfour.nl>
Mon, 17 Apr 2017 13:08:42 +0000 (15:08 +0200)
committerLukas Schauer <lukas@schauer.so>
Mon, 10 Jul 2017 17:59:52 +0000 (19:59 +0200)
dehydrated

index 92bdeda8ca82d3182d9935b1b698d4b9bf90973f..b32bdc8b0b68c8d4cd8ac87df7186b5c141cfb14 100755 (executable)
@@ -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}"