2weekmail/start.sh
2025-03-19 19:56:57 -05:00

26 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
echo "###########################################"
echo "Linking 2weekmail.fyi to nginx"
echo "###########################################"
ln -s $(pwd)/2weekmail.fyi /etc/nginx/sites-enabled/2weekmail.fyi
if ! nginx -t; then
echo "Nginx configuration test failed"
exit 1
fi
systemctl restart nginx
echo "###########################################"
echo "Building docker images"
echo "###########################################"
docker-compose build
docker-compose up -d
sleep 10
echo "###########################################"
echo "Adding admin email"
echo "###########################################"
docker exec -it mailserver_postfix setup email add admin@2weekmail.fyi
echo "###########################################"
echo "Setting up postfixadmin setup password"
echo "###########################################"
sed -i "s/\$CONF\['setup_password'\] = '.*'/\$CONF\['setup_password'\] = '\$2y\$10\$r8sytggmcWv7MLEavOILc.rCjV2uIhWeT6F1hI0zwORt6yL3ly\/9W'/g" ./config/postfixadmin/config.local.php