Update 'Main-Installer_V0.1.sh'

This commit is contained in:
2018-09-07 09:43:27 +00:00
parent bcc244003b
commit 7e43b4a6dd

View File

@@ -23,11 +23,9 @@
# > Postfix # > Postfix
#============================================================================== #==============================================================================
#-------------------# #------#
# Preconfiguration # # Menu #
#-------------------# #------#
cd /tmp
echo "UBUNTU 18.04 INSTALLATIE SCRIPT" echo "UBUNTU 18.04 INSTALLATIE SCRIPT"
echo Welk domein mag gekoppeld worden? Typ domein zonder www echo Welk domein mag gekoppeld worden? Typ domein zonder www
@@ -36,24 +34,6 @@ echo Standaard wachtwoord
read passwd read passwd
echo administrator email echo administrator email
read email read email
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get clean
apt-get autoremove -y
hostnamectl set-hostname $domain
sed -i 's/;preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg
timedatectl set-timezone Europe/Amsterdam
sed -i 's/#/vm.swappiness=10/g' /etc/sysctl.conf
sed -i 's/#/vm.vfs_cache_pressure=50/g' /etc/sysctl.conf
apt install rsync grsync sshpass -y
touch /etc/cron.d/updates
cat <<EOF > /etc/cron.d/updates
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow command
0 0 * * * apt-get update -y && apt-get upgrade -y &&apt-get dist-upgrade -y
EOF
echo "Webserver:" echo "Webserver:"
PS3='Keuze:' PS3='Keuze:'
options=("Apache" "Apache, Nginx reverse proxy" "Nginx, PHP-FPM" "Quit") options=("Apache" "Apache, Nginx reverse proxy" "Nginx, PHP-FPM" "Quit")
@@ -71,7 +51,7 @@ do
break;; break;;
"Quit") "Quit")
exit;; exit;;
*) echo "Fout antwoord $REPLY";; *) echo "Fout commando $REPLY";;
esac esac
done done
@@ -119,6 +99,30 @@ while true; do
esac esac
done done
#-------------------#
# Preconfiguration #
#-------------------#
cd /tmp
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt install rsync grsync sshpass -y
apt-get clean
apt-get autoremove -y
hostnamectl set-hostname $domain
sed -i 's/;preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg
timedatectl set-timezone Europe/Amsterdam
sed -i 's/#/vm.swappiness=10/g' /etc/sysctl.conf
sed -i 's/#/vm.vfs_cache_pressure=50/g' /etc/sysctl.conf
touch /etc/cron.d/updates
cat <<EOF > /etc/cron.d/updates
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow command
0 0 * * * apt-get update -y && apt-get upgrade -y &&apt-get dist-upgrade -y
EOF
#-------------------# #-------------------#
# Install Phase # # Install Phase #
#-------------------# #-------------------#
@@ -132,15 +136,33 @@ echo "***************************"
wget $script -O script.sh wget $script -O script.sh
source script.sh source script.sh
#-------------------#
# OPCACHE GUI #
#-------------------#
wget https://raw.githubusercontent.com/amnuts/opcache-gui/master/index.php -O /var/www/"$domain"/public_html/opcache.php
#----------------#
# PHP.info #
#----------------#
cat > /var/www/"$domain"/public_html/info.php <<- "EOF"
<?php
phpinfo();
?>
EOF
#--------------#
# Reboot #
#--------------#
echo "Install Succes" echo "Install Succes"
echo "Reboot system in:" echo "Reboot system in:"
sleep 1 sleep 1
echo "3"a echo 3
sleep 1 sleep 1
echo "2" echo 2
sleep 1 sleep 1
echo "1" echo 1
#reboot reboot
exit exit