From b0339372b5482781fffff6c39a286c01e5a2c65d Mon Sep 17 00:00:00 2001 From: Hassan A Hashim Date: Tue, 6 Aug 2024 17:12:54 +0300 Subject: [PATCH 1/2] Check `mailcow.conf` exists before source it --- update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 0c8f85fe..ddfd06de 100755 --- a/update.sh +++ b/update.sh @@ -404,12 +404,13 @@ while (($#)); do shift done +[[ ! -f mailcow.conf ]] && { echo "mailcow.conf is missing! Is mailcow installed?"; exit 1;} + chmod 600 mailcow.conf source mailcow.conf detect_docker_compose_command -[[ ! -f mailcow.conf ]] && { echo "mailcow.conf is missing! Is mailcow installed?"; exit 1;} DOTS=${MAILCOW_HOSTNAME//[^.]}; if [ ${#DOTS} -lt 1 ]; then echo -e "\e[31mMAILCOW_HOSTNAME (${MAILCOW_HOSTNAME}) is not a FQDN!\e[0m" From cc0dc2eae090fec01320d619b0008e82bebca315 Mon Sep 17 00:00:00 2001 From: Hassan A Hashim Date: Tue, 6 Aug 2024 17:51:46 +0300 Subject: [PATCH 2/2] Add color-coded error message for missing `mailcow.conf` --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index ddfd06de..6db943a0 100755 --- a/update.sh +++ b/update.sh @@ -404,7 +404,7 @@ while (($#)); do shift done -[[ ! -f mailcow.conf ]] && { echo "mailcow.conf is missing! Is mailcow installed?"; exit 1;} +[[ ! -f mailcow.conf ]] && { echo -e "\e[31mmailcow.conf is missing! Is mailcow installed?\e[0m"; exit 1;} chmod 600 mailcow.conf source mailcow.conf