Update 'installer.sh'
This commit is contained in:
51
installer.sh
51
installer.sh
@@ -66,7 +66,7 @@ debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Si
|
||||
##----------------##
|
||||
# Pre-Config #
|
||||
##----------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Pre-Configuring" 8 20
|
||||
TERM=ansi whiptail --title "Info" --infobox " Pre-Configuring" 8 52
|
||||
sleep 2
|
||||
hostnamectl set-hostname $domain > $OUTPUT 2>&1
|
||||
timedatectl set-timezone Europe/Amsterdam > $OUTPUT 2>&1
|
||||
@@ -90,7 +90,7 @@ chmod -R 755 /var/www
|
||||
##----------------------##
|
||||
# Pre-Requirements #
|
||||
##----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Buzzy like a bee" 8 20
|
||||
TERM=ansi whiptail --title "Info" --infobox " Buzzy like a bee" 8 52
|
||||
$PKGM update
|
||||
$PKGI software-properties-common
|
||||
$PKGA universe -y > $OUTPUT 2>&1
|
||||
@@ -114,7 +114,7 @@ $PKGM autoremove -y
|
||||
##-----------------------##
|
||||
# HTML Folder Perms #
|
||||
##-----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring HTML permissions" 8 32
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring HTML permissions" 8 52
|
||||
sleep 1
|
||||
chown -R www-data:www-data /var/www/"$domain"/html
|
||||
|
||||
@@ -122,7 +122,7 @@ chown -R www-data:www-data /var/www/"$domain"/html
|
||||
# NGINX #
|
||||
##-----------##
|
||||
#$PKGI nginx
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Nginx" 8 21
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Nginx" 8 52
|
||||
sleep 1
|
||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf
|
||||
|
||||
@@ -240,7 +240,7 @@ ln -s /etc/nginx/sites-available/"$domain" /etc/nginx/sites-enabled/
|
||||
##-------------------------------##
|
||||
# NGINX Single core bug fix #
|
||||
##-------------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Applying Nginx bug-fix" 8 26
|
||||
TERM=ansi whiptail --title "Info" --infobox " Applying Nginx bug-fix" 8 52
|
||||
sleep 1
|
||||
mkdir /etc/systemd/system/nginx.service.d
|
||||
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
|
||||
@@ -249,15 +249,14 @@ systemctl daemon-reload
|
||||
##-----------------------##
|
||||
# MySQL Installation #
|
||||
##-----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Installing MySQL" 8 20
|
||||
TERM=ansi whiptail --title "Info" --infobox " Installing MySQL" 8 52
|
||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-MySQL/raw/branch/master/mysql-8.0.sh -O /tmp/mysql-8.0.sh
|
||||
source /tmp/mysql-8.0.sh
|
||||
|
||||
##------------------------------##
|
||||
# MySQL_Secure_Installation #
|
||||
##------------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Securing MySQL" 8 19
|
||||
|
||||
TERM=ansi whiptail --title "Info" --infobox " Securing MySQL" 8 52
|
||||
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" > $OUTPUT 2>&1
|
||||
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User=''" > $OUTPUT 2>&1
|
||||
mysql -u root -p"$password" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" > $OUTPUT 2>&1
|
||||
@@ -268,7 +267,7 @@ mysql -u root -p"$password" -e "FLUSH PRIVILEGES;" > $OUTPUT 2>&1
|
||||
##-----------------------------##
|
||||
# MySQL Database Creation #
|
||||
##-----------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Creating MySQL Databases" 8 28
|
||||
TERM=ansi whiptail --title "Info" --infobox " Creating MySQL Databases" 8 52
|
||||
mysql -u root -p"$password" -e "CREATE DATABASE postfixadmin;" > $OUTPUT 2>&1
|
||||
mysql -u root -p"$password" -e "CREATE USER '"postfixadmin"'@'localhost' IDENTIFIED BY '"$password"';" > $OUTPUT 2>&1
|
||||
mysql -u root -p"$password" -e "GRANT ALL ON "postfixadmin".* TO "postfixadmin"@'localhost';" > $OUTPUT 2>&1
|
||||
@@ -280,7 +279,7 @@ mysql -u root -p"$password" -e "FLUSH PRIVILEGES;" > $OUTPUT 2>&1
|
||||
#$PKGI postfix postfix-mysql
|
||||
#$PKGI php${phpver} php${phpver}-zip php${phpver}-fpm php${phpver}-cli php${phpver}-json php${phpver}-mysql php${phpver}-opcache php${phpver}-mbstring php${phpver}-readline
|
||||
#$PKGI libc-client2007e mlock php${phpver}-common php${phpver}-imap
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring PostfixAdmin" 8 28
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring PostfixAdmin" 8 52
|
||||
mkdir -p /var/www/"$domain"/html/postfixadmin/templates_c
|
||||
wget -q -t7 https://git.ictmaatwerk.com/downloads/pfa/postfixadmin-3.1-dark.tar.gz -O /tmp/postfixadmin.tar.gz
|
||||
tar -xf /tmp/postfixadmin.tar.gz -C /var/www/"$domain"/html/postfixadmin --strip-components=1
|
||||
@@ -296,7 +295,7 @@ useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /var/mail/vmail -m vmail > $OUT
|
||||
##--------------------##
|
||||
# Certbot (Auto) #
|
||||
##--------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Certbot" 8 23
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Certbot" 8 52
|
||||
#add-apt-repository ppa:certbot/certbot -y
|
||||
#apt install -y python-certbot-nginx
|
||||
#certbot --nginx -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
@@ -310,7 +309,7 @@ TERM=ansi whiptail --title "Info" --infobox "Configuring Certbot" 8 23
|
||||
##----------------------##
|
||||
# Certbot (Manual) #
|
||||
##----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Certbot (manual)" 8 32
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Certbot (manual)" 8 52
|
||||
sleep 1
|
||||
mkdir -p /etc/letsencrypt/live/$domain/
|
||||
sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain"
|
||||
@@ -341,7 +340,7 @@ debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Si
|
||||
##---------------------------##
|
||||
# Postfix Configuration #
|
||||
##---------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Postfix" 8 23
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Postfix" 8 52
|
||||
sleep 1
|
||||
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
|
||||
@@ -392,7 +391,7 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/$bran
|
||||
##---------------------------##
|
||||
# Dovecot Configuration #
|
||||
##---------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Dovecot" 8 23
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Dovecot" 8 52
|
||||
sleep 1
|
||||
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
|
||||
@@ -412,7 +411,7 @@ chmod +x /usr/local/bin/quota-warning.sh
|
||||
##--------------------------------------##
|
||||
# Dovecot move Spam to Spam Folder #
|
||||
##--------------------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Spam Folder" 8 27
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Spam Folder" 8 52
|
||||
sleep 1
|
||||
#$PKGI dovecot-sieve dovecot-managesieved
|
||||
mkdir -p /etc/dovecot/sieve/
|
||||
@@ -428,7 +427,7 @@ chgrp dovecot /etc/dovecot/sieve/default.svbin > $OUTPUT 2>&1
|
||||
# Spamassassin #
|
||||
##------------------##
|
||||
#$PKGI spamassassin spamc razor pyzor
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Spamassassin" 8 28
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Spamassassin" 8 52
|
||||
sleep 1
|
||||
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
|
||||
@@ -454,7 +453,7 @@ echo "endif # Mail::SpamAssassin::Plugin::Shortcircuit" >> /etc/spamassassin/loc
|
||||
# ClamAV #
|
||||
##------------##
|
||||
#$PKGI clamav clamav-daemon clamsmtp libclamunrar7 clamdscan
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring ClamAV" 8 22
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring ClamAV" 8 52
|
||||
sleep 1
|
||||
mkdir -p /var/log/clamav
|
||||
mkdir -p /var/lib/clamav
|
||||
@@ -467,7 +466,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
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Amavis" 8 22
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Amavis" 8 52
|
||||
sleep 1
|
||||
sed -i -e 's/@bypass/'@bypass'/' -e 's/ / /' /etc/amavis/conf.d/15-content_filter_mode
|
||||
adduser clamav amavis >/dev/null
|
||||
@@ -502,7 +501,7 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra
|
||||
# Rainloop #
|
||||
##--------------##
|
||||
#$PKGI unzip
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Rainloop" 8 24
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Rainloop" 8 52
|
||||
sleep 1
|
||||
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
|
||||
@@ -512,7 +511,7 @@ ln -s /opt/rainloop /var/www/"$domain"/html/
|
||||
# Fail2Ban #
|
||||
##--------------##
|
||||
#$PKGI fail2ban
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Fail2Ban" 8 24
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Fail2Ban" 8 52
|
||||
sleep 1
|
||||
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
|
||||
@@ -524,7 +523,7 @@ systemctl restart fail2ban > $OUTPUT 2>&1
|
||||
##---------------------------------##
|
||||
# Unattended Security Updates #
|
||||
##---------------------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Configuring Unattended Security Updates" 8 43
|
||||
TERM=ansi whiptail --title "Info" --infobox " Configuring Unattended Security Updates" 8 52
|
||||
sleep 1
|
||||
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
|
||||
@@ -532,21 +531,21 @@ source /tmp/unattended.sh
|
||||
##-----------------------##
|
||||
# Enabling Services #
|
||||
##-----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Enabling Services" 8 21
|
||||
TERM=ansi whiptail --title "Info" --infobox " Enabling Services" 8 52
|
||||
sleep 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 #
|
||||
##-----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Restarting Services" 8 23
|
||||
TERM=ansi whiptail --title "Info" --infobox " Restarting Services" 8 52
|
||||
sleep 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 #
|
||||
##------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Final Update" 8 16
|
||||
TERM=ansi whiptail --title "Info" --infobox " Final Update" 8 52
|
||||
sleep 1
|
||||
$PKGM update
|
||||
$PKGM upgrade -y
|
||||
@@ -555,7 +554,7 @@ $PKGM autoremove -y
|
||||
##----------------------##
|
||||
# End of installer #
|
||||
##----------------------##
|
||||
TERM=ansi whiptail --title "Info" --infobox "Done installing!" 8 20
|
||||
TERM=ansi whiptail --title "Info" --infobox " Done installing!" 8 52
|
||||
sleep 3
|
||||
whiptail --title "Credits" --msgbox "Made by: your local Wizard and God" 8 38
|
||||
whiptail --title "Credits" --msgbox "Made by: your local Wizard and God" 8 52
|
||||
clear
|
||||
Reference in New Issue
Block a user