[Update] Check if run as root

master
andryyy 2019-01-29 12:13:04 +01:00
parent 8da54e5194
commit 4245780a66
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,11 @@
#!/usr/bin/env bash #!/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 #exit on error and pipefail
set -o pipefail set -o pipefail
@ -271,7 +277,14 @@ echo -e "Stopping mailcow... "
sleep 2 sleep 2
docker-compose down 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 # Silently fixing remote url from andryyy to mailcow
git remote set-url origin https://github.com/mailcow/mailcow-dockerized git remote set-url origin https://github.com/mailcow/mailcow-dockerized
echo -e "\e[32mCommitting current status...\e[0m" echo -e "\e[32mCommitting current status...\e[0m"