]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
use _exiterr helper in a few more places
authorLukas Schauer <lukas@schauer.so>
Fri, 8 Jan 2016 18:48:02 +0000 (19:48 +0100)
committerLukas Schauer <lukas@schauer.so>
Fri, 8 Jan 2016 19:00:30 +0000 (20:00 +0100)
letsencrypt.sh

index fe0098cfd92fd649a8289ae71abf28b559c3ca58..751c5e341bb93ca38d7f0cbd1aa5ad73d3407c5f 100755 (executable)
@@ -52,18 +52,14 @@ load_config() {
     # shellcheck disable=SC1090
     . "${CONFIG}"
   else
-    echo "Specified config file doesn't exist." >&2
-    exit 1
+    _exiterr "Specified config file doesn't exist."
   fi
 
   # Remove slash from end of BASEDIR. Mostly for cleaner outputs, doesn't change functionality.
   BASEDIR="${BASEDIR%%/}"
 
   # Check BASEDIR and set default variables
-  if [[ ! -d "${BASEDIR}" ]]; then
-   echo "BASEDIR does not exist: ${BASEDIR}" >&2
-   exit 1
-  fi
+  [[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
 }
 
 # Initialize system