Update mail-user.sh

This commit is contained in:
myve 2024-03-22 13:12:44 -06:00
commit 8b9d67186a

View file

@ -1,3 +1,12 @@
# Static variables
ip_addr=$(wget -q4O- ipv4.icanhazip.com)
subdomain=$(hostname | awk -F . '{print $1}')
domain="$(hostname | awk -F . '{print $2}').$(hostname | awk -F . '{print $3}')"
eff_email='eff@'${domain}
roundcubedbpass=$(cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 128 | head -n 1)
postfixadmindbpass=$(cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 128 | head -n 1)
roundcubepass_strength_drive=$(cat /dev/urandom | tr -d -c 'a-z' | fold -w 8 | head -n 1)
# UFW # UFW
sudo ufw allow 25/tcp &>/dev/null sudo ufw allow 25/tcp &>/dev/null
sudo ufw allow 80,443/tcp >/dev/null sudo ufw allow 80,443/tcp >/dev/null
@ -19,15 +28,6 @@ function die
exit 1 exit 1
} }
# Static variables
ip_addr=$(wget -q4O- ipv4.icanhazip.com)
subdomain=$(hostname | awk -F . '{print $1}')
domain="$(hostname | awk -F . '{print $2}').$(hostname | awk -F . '{print $3}')"
eff_email='eff@'${domain}
roundcubedbpass=$(cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 128 | head -n 1)
postfixadmindbpass=$(cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 128 | head -n 1)
roundcubepass_strength_drive=$(cat /dev/urandom | tr -d -c 'a-z' | fold -w 8 | head -n 1)
# Exit if static variable is null # Exit if static variable is null
if [ -z ${ip_addr} ] || [ -z ${subdomain} ] || [ -z ${domain} ] || [ -z ${eff_email} ] if [ -z ${ip_addr} ] || [ -z ${subdomain} ] || [ -z ${domain} ] || [ -z ${eff_email} ]
then then