minor improvements
authorIan Kelling <ian@iankelling.org>
Mon, 2 Nov 2020 01:09:38 +0000 (20:09 -0500)
committerIan Kelling <ian@iankelling.org>
Mon, 2 Nov 2020 01:09:38 +0000 (20:09 -0500)
mail-setup

index 1798fd67f3947f7ae5472a8d0a7e0ea23992e6b8..18f0357ffe67538956d1ed42d97e4b5125e7383e 100755 (executable)
@@ -82,7 +82,6 @@ elif [[ -s /a/bin/errhandle/err ]]; then
   source /a/bin/errhandle/err
 else
   err "no err tracing script found"
-  exit 1
 fi
 source /a/bin/distro-functions/src/identify-distros
 source /a/bin/distro-functions/src/package-manager-abstractions
@@ -231,7 +230,7 @@ fi
 pre="${0##*/}:"
 m() { printf "$pre %s\n"  "$*"; "$@"; }
 e() { printf "$pre %s\n"  "$*"; }
-err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $0: $*" >&2; }
+err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $0: $*" >&2; exit 1; }
 reload=false
 i() { # install file
   local tmp tmpdir dest="$1"
@@ -466,7 +465,7 @@ m chattr +i /etc/nn-resolv/stub-resolv.conf
 
 
 nn_progs=(exim4)
-if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
+if mailhost; then
   # Note dovecots lmtp doesnt need to be in the same nn to accept delivery.
   nn_progs+=(spamassassin dovecot)
 fi