From 8b9d67186a80b57a76db525809d086565f2290c7 Mon Sep 17 00:00:00 2001 From: myve Date: Fri, 22 Mar 2024 13:12:44 -0600 Subject: [PATCH] Update mail-user.sh --- mail-user.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mail-user.sh b/mail-user.sh index 3f5f2cc..5b2ad69 100644 --- a/mail-user.sh +++ b/mail-user.sh @@ -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 sudo ufw allow 25/tcp &>/dev/null sudo ufw allow 80,443/tcp >/dev/null @@ -19,15 +28,6 @@ function die 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 if [ -z ${ip_addr} ] || [ -z ${subdomain} ] || [ -z ${domain} ] || [ -z ${eff_email} ] then