From 07f5f1a624837edb6e4b787d5522098193e90081 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 20 Sep 2018 15:56:13 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9placement=20du=20"set=20-u"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evomaintenance.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/evomaintenance.sh b/evomaintenance.sh index 97a8dff..f5437d9 100644 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -7,9 +7,6 @@ # version 0.3 # Copyright 2007-2018 Gregory Colpart , Jérémy Lecour , Evolix -# Treat unset variables as an error when substituting. -set -u - test -f /etc/evomaintenance.cf && . /etc/evomaintenance.cf [ -n "${HOSTNAME}" ] || HOSTNAME=$(hostname) @@ -17,6 +14,10 @@ test -f /etc/evomaintenance.cf && . /etc/evomaintenance.cf [ -n "${EVOMAINTMAIL}" ] || EVOMAINTMAIL=evomaintenance-$(echo "${HOSTNAME_INTERNAL}" | cut -d- -f1)@${REALM} [ -n "${LOGFILE}" ] || LOGFILE=/var/log/evomaintenance.log +# Treat unset variables as an error when substituting. +# Only after this line, because some config variables might be missing. +set -u + if [ "${HOSTNAME}" = "${HOSTNAME_INTERNAL}" ]; then HOSTNAME_TEXT="${HOSTNAME}" else