Update 'installer.sh'

This commit is contained in:
b.waal
2019-09-17 13:18:02 +02:00
parent 11a74b2a99
commit 663ced9791

View File

@@ -23,7 +23,7 @@ PKGA="add-apt-repository"
PKGI="${PKGM} install -y" PKGI="${PKGM} install -y"
if [ $IMODE = n ]; then if [ $IMODE = n ]; then
whiptail --title "Ubuntu 18.04 Mail Installer" --infobox "" 8 45 TERM=ansi whiptail --title "Ubuntu 18.04 Mail Installer" --infobox "" 8 45
sleep 3 sleep 3
if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno "Do you want to install a mail server?" 8 78) if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno "Do you want to install a mail server?" 8 78)
then then
@@ -320,7 +320,7 @@ useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /var/mail/vmail -m vmail > $OUT
##----------------------## ##----------------------##
# Certbot (Manual) # # Certbot (Manual) #
##----------------------## ##----------------------##
whiptail --title "Configuring Certbot (manual)" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Configuring Certbot (manual)" --infobox "Busy like a bee" 8 45
mkdir -p /etc/letsencrypt/live/$domain/ mkdir -p /etc/letsencrypt/live/$domain/
sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain" sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain"
sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/nginx/sites-available/"$domain" sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/nginx/sites-available/"$domain"
@@ -350,7 +350,7 @@ debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Si
##---------------------------## ##---------------------------##
# Postfix Configuration # # Postfix Configuration #
##---------------------------## ##---------------------------##
whiptail --title "Configuring Postfix" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Configuring Postfix" --infobox "Busy like a bee" 8 45
mkdir -p /etc/postfix/sql mkdir -p /etc/postfix/sql
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/postfix/mysql_virtual_alias_domain_catchall_maps.cf -O /etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/postfix/mysql_virtual_alias_domain_catchall_maps.cf -O /etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/postfix/mysql_virtual_alias_domain_mailbox_maps.cf -O /etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/postfix/mysql_virtual_alias_domain_mailbox_maps.cf -O /etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
@@ -400,7 +400,7 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/$bran
##---------------------------## ##---------------------------##
# Dovecot Configuration # # Dovecot Configuration #
##---------------------------## ##---------------------------##
whiptail --title "Configuring Dovecot" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Configuring Dovecot" --infobox "Busy like a bee" 8 45
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/dovecot/15-mailboxes.conf -O /etc/dovecot/conf.d/15-mailboxes.conf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/dovecot/15-mailboxes.conf -O /etc/dovecot/conf.d/15-mailboxes.conf
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/dovecot/10-mail.conf -O /etc/dovecot/conf.d/10-mail.conf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/dovecot/10-mail.conf -O /etc/dovecot/conf.d/10-mail.conf
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/dovecot/10-auth.conf -O /etc/dovecot/conf.d/10-auth.conf wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/dovecot/10-auth.conf -O /etc/dovecot/conf.d/10-auth.conf
@@ -433,7 +433,7 @@ chgrp dovecot /etc/dovecot/sieve/default.svbin > $OUTPUT 2>&1
# Spamassassin # # Spamassassin #
##------------------## ##------------------##
#$PKGI spamassassin spamc razor pyzor #$PKGI spamassassin spamc razor pyzor
whiptail --title "Configuring Spamassassin" --infobox "Busy like a bee" 8 45 TERM=ansi 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 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 "" >> /etc/spamassassin/local.cf
echo "skip_rbl_checks 0" >> /etc/spamassassin/local.cf echo "skip_rbl_checks 0" >> /etc/spamassassin/local.cf
@@ -471,7 +471,7 @@ chmod 775 -R /var/lib/clamav/* /var/lib/clamav
##------------## ##------------##
#$PKGI amavisd-new #$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 #$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 TERM=ansi 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 sed -i -e 's/@bypass/'@bypass'/' -e 's/ / /' /etc/amavis/conf.d/15-content_filter_mode
adduser clamav amavis >/dev/null adduser clamav amavis >/dev/null
sed -i 's/clamd.conf/'clamd.conf'/g' /etc/clamav/freshclam.conf sed -i 's/clamd.conf/'clamd.conf'/g' /etc/clamav/freshclam.conf
@@ -505,7 +505,7 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra
# Rainloop # # Rainloop #
##--------------## ##--------------##
#$PKGI unzip #$PKGI unzip
whiptail --title "Configuring Rainloop" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Configuring Rainloop" --infobox "Busy like a bee" 8 45
sleep 2 sleep 2
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/rainloop.sh -O /tmp/rainloop.sh wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/rainloop.sh -O /tmp/rainloop.sh
source /tmp/rainloop.sh > $OUTPUT 2>&1 source /tmp/rainloop.sh > $OUTPUT 2>&1
@@ -515,7 +515,7 @@ ln -s /opt/rainloop /var/www/"$domain"/html/
# Fail2Ban # # Fail2Ban #
##--------------## ##--------------##
#$PKGI fail2ban #$PKGI fail2ban
whiptail --title "Configuring Fail2Ban" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Configuring Fail2Ban" --infobox "Busy like a bee" 8 45
sleep 2 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/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/postfix-sasl.conf -O /etc/fail2ban/filter.d/postfix-sasl.conf
@@ -533,21 +533,21 @@ source /tmp/unattended.sh
##-----------------------## ##-----------------------##
# Enabling Services # # Enabling Services #
##-----------------------## ##-----------------------##
whiptail --title "Enabling Services" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Enabling Services" --infobox "Busy like a bee" 8 45
sleep 2 sleep 2
systemctl enable nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent > $OUTPUT 2>&1 systemctl enable nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent > $OUTPUT 2>&1
##-----------------------## ##-----------------------##
# Starting Services # # Starting Services #
##-----------------------## ##-----------------------##
whiptail --title "Restarting Services" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Restarting Services" --infobox "Busy like a bee" 8 45
sleep 2 sleep 2
systemctl restart nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent > $OUTPUT 2>&1 systemctl restart nginx mysql postfix postfix@- dovecot fail2ban clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-snmp-subagent amavis-mc amavis-snmp-subagent > $OUTPUT 2>&1
##------------------## ##------------------##
# Final Update # # Final Update #
##------------------## ##------------------##
whiptail --title "Finalizing Update" --infobox "Busy like a bee" 8 45 TERM=ansi whiptail --title "Finalizing Update" --infobox "Busy like a bee" 8 45
sleep 2 sleep 2
$PKGM update $PKGM update
$PKGM upgrade -y $PKGM upgrade -y
@@ -556,7 +556,7 @@ $PKGM autoremove -y
##----------------------## ##----------------------##
# End of installer # # End of installer #
##----------------------## ##----------------------##
whiptail --title "Done installing!" --infobox "" 8 45 TERM=ansi whiptail --title "Done installing!" --infobox "" 8 45
sleep 3 sleep 3
whiptail --title "Credits" --msgbox "Made by: your local Wizard and God" 8 78 whiptail --title "Credits" --msgbox "Made by: your local Wizard and God" 8 78
clear clear