From b3ed80967dac93bef229f9947e0917cbd9bc7708 Mon Sep 17 00:00:00 2001 From: "b.waal" Date: Sun, 15 Sep 2019 18:16:57 +0200 Subject: [PATCH] Updated menu --- installer.sh | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/installer.sh b/installer.sh index 502fca0..7c903d9 100644 --- a/installer.sh +++ b/installer.sh @@ -21,14 +21,13 @@ fi PKGA="add-apt-repository" PKGI="${PKGM} install -y" - - if [ $IMODE = n ]; then if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno "Do you want to install a mail server?" 8 78) then echo "" >/dev/null else exit + clear fi password=$(whiptail --nocancel --passwordbox "Please enter your password" 8 78 --title "Statics dialog" 3>&1 1>&2 2>&3) domain=$(whiptail --nocancel --inputbox "Enter the Domain without WWW" 8 78 --title "Statics dialog" 3>&1 1>&2 2>&3) @@ -296,8 +295,8 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/lets-encrypt/fullchain.pem -O /etc/letsencrypt/live/$domain/fullchain.pem wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/lets-encrypt/privkey.pem -O /etc/letsencrypt/live/$domain/privkey.pem wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/nginx/site-enabled -O /etc/nginx/sites-available/mail.ictdownwerk.com -openssl dhparam -out /etc/ssl/certs/dhparam.pem "$dhparam" >/dev/null -openssl dhparam -out /etc/letsencrypt/ssl-dhparams.pem "$dhparam" >/dev/null +openssl dhparam -out /etc/ssl/certs/dhparam.pem "$dhparam" > /dev/null 2>&1 +openssl dhparam -out /etc/letsencrypt/ssl-dhparams.pem "$dhparam" > /dev/null 2>&1 chmod 777 -R /etc/letsencrypt/ssl-dhparams.pem chmod 777 -R /etc/ssl/certs/dhparam.pem chmod 777 -R /etc/letsencrypt/live/$domain/cert.pem @@ -399,6 +398,7 @@ chgrp dovecot /etc/dovecot/sieve/default.svbin >/dev/null # Spamassassin # ##------------------## $PKGI spamassassin spamc razor pyzor +whiptail --title "Configuring Spamassassin" --infobox "Busy like a bee" 8 45 sed -i -e 's/# report_safe 1/report_safe 0/' -e 's/# required_score 5.0/required_score 5.0/' -e 's/endif # Mail::SpamAssassin::Plugin::Shortcircuit//' /etc/spamassassin/local.cf echo "" >> /etc/spamassassin/local.cf echo "skip_rbl_checks 0" >> /etc/spamassassin/local.cf @@ -423,6 +423,8 @@ echo "endif # Mail::SpamAssassin::Plugin::Shortcircuit" >> /etc/spamassassin/loc # ClamAV # ##------------## $PKGI clamav clamav-daemon clamsmtp libclamunrar7 clamdscan +whiptail --title "Configuring ClamAV" --infobox "Busy like a bee" 8 45 +sleep 2 mkdir -p /var/log/clamav mkdir -p /var/lib/clamav chown -R clamav:clamav /var/log/clamav @@ -434,6 +436,7 @@ chmod 775 -R /var/lib/clamav/* /var/lib/clamav ##------------## $PKGI amavisd-new $PKGI zip lrzip liblz4-tool lhasa arj unzip bzip2 nomarch cpio lzop cabextract arc apt-listchanges libauthen-sasl-perl libdbd-mysql-perl libdbi-perl libmail-dkim-perl ripole p7zip p7zip-full p7zip-rar rpm unrar unrar-free altermime libsnmp-perl libnet-ldap-perl libnet-ph-perl libnet-snpp-perl libnet-telnet-perl +whiptail --title "Configuring Amavis" --infobox "Busy like a bee" 8 45 sed -i -e 's/@bypass/'@bypass'/' -e 's/ / /' /etc/amavis/conf.d/15-content_filter_mode adduser clamav amavis >/dev/null sed -i 's/clamd.conf/'clamd.conf'/g' /etc/clamav/freshclam.conf @@ -467,40 +470,51 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra # Rainloop # ##--------------## $PKGI unzip +whiptail --title "Configuring Rainloop" --infobox "Busy like a bee" 8 45 +sleep 2 wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/rainloop.sh -O /tmp/rainloop.sh -source /tmp/rainloop.sh >/dev/null +source /tmp/rainloop.sh > /dev/null 2>&1 ln -s /opt/rainloop /var/www/"$domain"/html/ ##--------------## # Fail2Ban # ##--------------## $PKGI fail2ban +whiptail --title "Configuring Fail2Ban" --infobox "Busy like a bee" 8 45 +sleep 2 wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/fail2ban/dovecot-pop3imap.conf -O /etc/fail2ban/filter.d/dovecot-pop3imap.conf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/fail2ban/postfix-sasl.conf -O /etc/fail2ban/filter.d/postfix-sasl.conf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/fail2ban/rainloop.conf -O /etc/fail2ban/filter.d/rainloop.conf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/fail2ban/jail.local -O /etc/fail2ban/jail.local sed -i 's/root@localhost/'$email'/g' /etc/fail2ban/jail.conf -systemctl restart fail2ban >/dev/null +systemctl restart fail2ban > /dev/null 2>&1 ##---------------------------------## # Unattended Security Updates # ##---------------------------------## wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Unattended-Security-Updates/raw/branch/master/installer.sh -O /tmp/unattended.sh -source /tmp/unattended.sh >/dev/null +source /tmp/unattended.sh > /dev/null 2>&1 ##-----------------------## # Enabling Services # ##-----------------------## -systemctl enable nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent >/dev/null +systemctl enable nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent > /dev/null 2>&1 ##-----------------------## # Starting Services # ##-----------------------## -systemctl restart nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent >/dev/null +systemctl restart nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent > /dev/null 2>&1 ##------------------## # Final Update # ##------------------## $PKGM update $PKGM upgrade -y -$PKGM autoremove -y \ No newline at end of file +$PKGM autoremove -y + +##----------------------## +# End of installer # +##----------------------## +whiptail --title "Done installing!" --infobox "Busy like a bee" 8 45 +sleep 3 +whiptail --title "Credits" --msgbox "Made by: B.Prieshof & B.Waal" 8 78 \ No newline at end of file