117 lines
2.9 KiB
Bash
117 lines
2.9 KiB
Bash
#!/bin/bash
|
|
###============================================================
|
|
## Ubuntu 18.04 Additional Domain Installer
|
|
###============================================================
|
|
## Zet comments hieronder:
|
|
#
|
|
#
|
|
#
|
|
##=============================================================
|
|
|
|
##----------##
|
|
# Menu #
|
|
##----------##
|
|
|
|
echo "Ubuntu 18.04 extra domein installatie script."
|
|
|
|
echo "WAARSHUWING: De standaard php versie is 7.3 controleer welke versie op de server staat"
|
|
echo "pas dit aan in de variable ¨phpver¨ als er andere versie is geinstleerd"
|
|
read -p "Druk enter om door tegaan"
|
|
|
|
echo "Domein zonder www:"
|
|
read domain
|
|
while true; do
|
|
read -p "bestaat www.${domain} in DNS -> yes/no?" yn
|
|
case $yn in
|
|
[Yy]* ) domainwww=1
|
|
break;;
|
|
[Nn]* ) domainwww=0
|
|
break;;
|
|
* ) echo "Kies yes of no.";;
|
|
esac
|
|
done
|
|
echo "Algemeen wachtwoord:"
|
|
read password
|
|
echo "Administrator email:"
|
|
read email
|
|
echo "Webserver:"
|
|
PS3='Keuze:'
|
|
options=("Apache" "Nginx proxy" "Nginx proxy & standalone" "Nginx, PHP-FPM" "Quit")
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
"Apache")
|
|
script=https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/Extra_Domains/Apache_Domain.sh
|
|
break;;
|
|
"Nginx proxy")
|
|
script=https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/Extra_Domains/RevProxySimple_Domain.sh
|
|
break;;
|
|
"Nginx proxy & standalone")
|
|
script=https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/mastermaster/Extra_Domains/RevProxyAdvanced_Domain.sh
|
|
break;;
|
|
"Nginx, PHP-FPM")
|
|
script=https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/Extra_Domains/NGINX_Domain.sh
|
|
break;;
|
|
"Quit")
|
|
exit;;
|
|
*) echo "Fout commando $REPLY";;
|
|
esac
|
|
done
|
|
|
|
while true; do
|
|
read -p "Installeer Netdata -> yes/no?" yn
|
|
case $yn in
|
|
[Yy]* ) netdata=1
|
|
break;;
|
|
[Nn]* ) netdata=0
|
|
break;;
|
|
* ) echo "Kies yes of no.";;
|
|
esac
|
|
done
|
|
|
|
while true; do
|
|
read -p "Installeer Wordpress -> yes/no?" yn
|
|
case $yn in
|
|
[Yy]* ) wordpress=1
|
|
break;;
|
|
[Nn]* ) wordpress=0
|
|
break;;
|
|
* ) echo "Kies yes of no.";;
|
|
esac
|
|
done
|
|
|
|
##-----------------##
|
|
# Static-Vars #
|
|
##-----------------##
|
|
|
|
phpver=7.3
|
|
|
|
##----------------##
|
|
# Pre-Config #
|
|
##----------------##
|
|
|
|
cd /tmp
|
|
# Make sure all repositories and packages are up-to-date
|
|
apt update
|
|
apt upgrade -y
|
|
apt dist-upgrade -y
|
|
apt clean
|
|
apt autoremove -y
|
|
# Setup domain folder
|
|
mkdir -p /var/www/"$domain"/html
|
|
chmod -R 755 /var/www
|
|
|
|
##-------------------##
|
|
# Install Phase #
|
|
##-------------------##
|
|
|
|
echo "****************************"
|
|
sleep 0.5
|
|
echo "Installatie duurt 1 minuut."
|
|
sleep 0.5
|
|
echo "****************************"
|
|
|
|
wget $script -O Ubuntu-Domain_Installer.sh
|
|
source Ubuntu-Domain_Installer.sh
|
|
|
|
echo "Installatie geslaagd!" |