Updated menu
This commit is contained in:
34
installer.sh
34
installer.sh
@@ -21,14 +21,13 @@ fi
|
|||||||
PKGA="add-apt-repository"
|
PKGA="add-apt-repository"
|
||||||
PKGI="${PKGM} install -y"
|
PKGI="${PKGM} install -y"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ $IMODE = n ]; then
|
if [ $IMODE = n ]; then
|
||||||
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
|
||||||
echo "" >/dev/null
|
echo "" >/dev/null
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
|
clear
|
||||||
fi
|
fi
|
||||||
password=$(whiptail --nocancel --passwordbox "Please enter your password" 8 78 --title "Statics dialog" 3>&1 1>&2 2>&3)
|
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)
|
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/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/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
|
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/ssl/certs/dhparam.pem "$dhparam" > /dev/null 2>&1
|
||||||
openssl dhparam -out /etc/letsencrypt/ssl-dhparams.pem "$dhparam" >/dev/null
|
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/letsencrypt/ssl-dhparams.pem
|
||||||
chmod 777 -R /etc/ssl/certs/dhparam.pem
|
chmod 777 -R /etc/ssl/certs/dhparam.pem
|
||||||
chmod 777 -R /etc/letsencrypt/live/$domain/cert.pem
|
chmod 777 -R /etc/letsencrypt/live/$domain/cert.pem
|
||||||
@@ -399,6 +398,7 @@ chgrp dovecot /etc/dovecot/sieve/default.svbin >/dev/null
|
|||||||
# Spamassassin #
|
# Spamassassin #
|
||||||
##------------------##
|
##------------------##
|
||||||
$PKGI spamassassin spamc razor pyzor
|
$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
|
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
|
||||||
@@ -423,6 +423,8 @@ echo "endif # Mail::SpamAssassin::Plugin::Shortcircuit" >> /etc/spamassassin/loc
|
|||||||
# ClamAV #
|
# ClamAV #
|
||||||
##------------##
|
##------------##
|
||||||
$PKGI clamav clamav-daemon clamsmtp libclamunrar7 clamdscan
|
$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/log/clamav
|
||||||
mkdir -p /var/lib/clamav
|
mkdir -p /var/lib/clamav
|
||||||
chown -R clamav:clamav /var/log/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 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
|
||||||
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
|
||||||
@@ -467,40 +470,51 @@ 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
|
||||||
|
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 >/dev/null
|
source /tmp/rainloop.sh > /dev/null 2>&1
|
||||||
ln -s /opt/rainloop /var/www/"$domain"/html/
|
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
|
||||||
|
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
|
||||||
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/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
|
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
|
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 #
|
# Unattended Security Updates #
|
||||||
##---------------------------------##
|
##---------------------------------##
|
||||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Unattended-Security-Updates/raw/branch/master/installer.sh -O /tmp/unattended.sh
|
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 #
|
# 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 #
|
# 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 #
|
# Final Update #
|
||||||
##------------------##
|
##------------------##
|
||||||
$PKGM update
|
$PKGM update
|
||||||
$PKGM upgrade -y
|
$PKGM upgrade -y
|
||||||
$PKGM autoremove -y
|
$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
|
||||||
Reference in New Issue
Block a user