From a6a911871b69dbf63975d5a8cc6f0b09ddae81b2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 22 Oct 2016 17:36:21 +0100 Subject: [PATCH] Displaying email hostnames --- src/freedombone-controlpanel | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 057a9d3e..02b253d4 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -1529,25 +1529,27 @@ function email_extra_domains { trap "rm -f $data" 0 1 2 5 15 dialog --title $"Email Domains" \ --backtitle $"Freedombone Control Panel" \ - --inputbox $"Enter the list of email domains to use, separated by semicolons" 8 60 2>$data + --inputbox $"Enter the list of email domains to use, separated by semicolons" 8 60 $email_hostnames 2>$data sel=$? case $sel in 0) emailhostnames=$(<$data) if [ ${#emailhostnames} -gt 2 ]; then - if [[ "$emailhostnames" == *"."* ]]; then - if [[ "$emailhostnames" != *" "* ]]; then - sed -i "s|dc_other_hostnames=.*|dc_other_hostnames='$emailhostnames'|g" /etc/exim4/update-exim4.conf.conf - update-exim4.conf - dpkg-reconfigure --frontend noninteractive exim4-config - systemctl restart saslauthd - dialog --title $"Email Domains" \ - --backtitle $"Freedombone Control Panel" \ - --msgbox $"Email domains were changed" 6 50 - else - dialog --title $"Email Domains not set" \ - --backtitle $"Freedombone Control Panel" \ - --msgbox $"There should be no spaces in the list" 6 50 + if [[ "$email_hostnames" != "$emailhostnames" ]]; then + if [[ "$emailhostnames" == *"."* ]]; then + if [[ "$emailhostnames" != *" "* ]]; then + sed -i "s|dc_other_hostnames=.*|dc_other_hostnames='$emailhostnames'|g" /etc/exim4/update-exim4.conf.conf + update-exim4.conf + dpkg-reconfigure --frontend noninteractive exim4-config + systemctl restart saslauthd + dialog --title $"Email Domains" \ + --backtitle $"Freedombone Control Panel" \ + --msgbox $"Email domains were changed" 6 50 + else + dialog --title $"Email Domains not set" \ + --backtitle $"Freedombone Control Panel" \ + --msgbox $"There should be no spaces in the list" 6 50 + fi fi fi fi