From 4245780a6697f603125870995f4e9bdc3db449d6 Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 29 Jan 2019 12:13:04 +0100 Subject: [PATCH] [Update] Check if run as root --- update.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index fb86da21..76e40805 100755 --- a/update.sh +++ b/update.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +# Check permissions +if [ "$(id -u)" -ne "0" ]; then + echo "You need to be root" + exit 1 +fi + #exit on error and pipefail set -o pipefail @@ -271,7 +277,14 @@ echo -e "Stopping mailcow... " sleep 2 docker-compose down -# Fix header check +# Fix Rspamd maps +if [ -f data/conf/rspamd/custom/global_from_blacklist.map ]; then + mv data/conf/rspamd/custom/global_from_blacklist.map data/conf/rspamd/custom/global_smtp_from_blacklist.map +fi +if [ -f data/conf/rspamd/custom/global_from_whitelist.map ]; then + mv data/conf/rspamd/custom/global_from_whitelist.map data/conf/rspamd/custom/global_smtp_from_whitelist.map +fi + # Silently fixing remote url from andryyy to mailcow git remote set-url origin https://github.com/mailcow/mailcow-dockerized echo -e "\e[32mCommitting current status...\e[0m"