From a408f2f8288d63c898ad7352721b51def4fe19db Mon Sep 17 00:00:00 2001 From: earnolmartin Date: Tue, 22 May 2018 10:22:25 -0600 Subject: [PATCH] Minor Changes to Install and Update Process --- ehcp/ehcpforceupdate.sh | 30 ++++++++++++++++-------------- ehcp/install_main.sh | 10 ++++++---- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ehcp/ehcpforceupdate.sh b/ehcp/ehcpforceupdate.sh index b6b8f2d..b1616df 100755 --- a/ehcp/ehcpforceupdate.sh +++ b/ehcp/ehcpforceupdate.sh @@ -1468,6 +1468,22 @@ function installAntiSpam(){ # Install Anti-Spam Software aptgetInstall "amavisd-new" "runlevel=1" # amavisd-new install should not start the daemon immediately after installation since we haven't configured our fully qualified domain name of the server yet + + # Prompt for FQDN + echo "" + echo -n "Please enter your Fully Qualified Domain Name (FQDN) for this mail server: " + read FQDNName + FQDNName=$(echo "$FQDNName" | awk '{print tolower($0)}') + if [ -z "$FQDNName" ]; then + # Just replace it with ehcpforce.tk + sed -i "s/^#\$myhostname.*/\$myhostname = \"ehcpforce.tk\";/g" "$AMAVISHOST" + sed -i "s#^\$myhostname.*#\$myhostname = \"ehcpforce.tk\";#g" "$AMAVISHOST" + else + sed -i "s/^#\$myhostname.*/\$myhostname = \"$FQDNName\";/g" "$AMAVISHOST" + sed -i "s#^\$myhostname.*#\$myhostname = \"$FQDNName\";#g" "$AMAVISHOST" + fi + + # Install SpamAssassin and Clamav-Daemon aptgetInstall "spamassassin clamav-daemon" # Install individually incase some packages are not found @@ -1608,20 +1624,6 @@ smtp-amavis unix - - - - 2 smtp if [ -z "$POSTFIXMASCHECK4" ]; then sed -i "/pickup.*/a\\\t-o content_filter=" "$PostFixMaster" fi - - # Prompt for FQDN - echo "" - echo -n "Please enter your Fully Qualified Domain Name (FQDN) for this mail server: " - read FQDNName - FQDNName=$(echo "$FQDNName" | awk '{print tolower($0)}') - if [ -z "$FQDNName" ]; then - # Just replace it with ehcpforce.tk - sed -i "s/^#\$myhostname.*/\$myhostname = \"ehcpforce.tk\";/g" "$AMAVISHOST" - sed -i "s#^\$myhostname.*#\$myhostname = \"ehcpforce.tk\";#g" "$AMAVISHOST" - else - sed -i "s/^#\$myhostname.*/\$myhostname = \"$FQDNName\";/g" "$AMAVISHOST" - sed -i "s#^\$myhostname.*#\$myhostname = \"$FQDNName\";#g" "$AMAVISHOST" - fi # Change settings for amavis deb defaults if [ -e "$AMAVISDEBDEFAULTSCONF" ]; then diff --git a/ehcp/install_main.sh b/ehcp/install_main.sh index 8afdca8..46a1577 100755 --- a/ehcp/install_main.sh +++ b/ehcp/install_main.sh @@ -1337,6 +1337,12 @@ function installAntiSpam(){ # Install Anti-Spam Software aptgetInstall "amavisd-new" "runlevel=1" # amavisd-new install should not start the daemon immediately after installation since we haven't configured our fully qualified domain name of the server yet + + # Use FQDN for mail server (used by Amavis) as entered by user earlier + sed -i "s/^#\$myhostname.*/\$myhostname = \"$FQDNName\";/g" "$AMAVISHOST" + sed -i "s#^\$myhostname.*#\$myhostname = \"$FQDNName\";#g" "$AMAVISHOST" + + # Install SpamAssassin and Clamav-Daemon aptgetInstall "spamassassin clamav-daemon" # Install individually incase some packages are not found @@ -1477,10 +1483,6 @@ smtp-amavis unix - - - - 2 smtp if [ -z "$POSTFIXMASCHECK4" ]; then sed -i "/pickup.*/a\\\t-o content_filter=" "$PostFixMaster" fi - - # Use FQDN for mail server (used by Amavis) as entered by user earlier - sed -i "s/^#\$myhostname.*/\$myhostname = \"$FQDNName\";/g" "$AMAVISHOST" - sed -i "s#^\$myhostname.*#\$myhostname = \"$FQDNName\";#g" "$AMAVISHOST" # Change settings for amavis deb defaults if [ -e "$AMAVISDEBDEFAULTSCONF" ]; then