Files
VPS-scripts_Ubuntu-Web-V1/Extra_Domains/Domain_Installer.sh
2018-10-03 11:09:05 +02:00

82 lines
1.8 KiB
Bash

#!/bin/bash
###============================================================
## Ubuntu 18.04 Additional Domain Installer
###============================================================
## Zet comments hieronder:
#
#
#
##=============================================================
##----------##
# Menu #
##----------##
echo "Ubuntu 18.04 extra domein installatie script."
echo "Domein zonder www:"
read domain
echo "Algemeen wachtwoord:"
read password
echo "Administrator email:"
read email
echo "Webserver:"
PS3='Keuze:'
options=("Apache" "Apache, Nginx reverse proxy" "Nginx, PHP-FPM" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Apache")
script=temp_filler
break;;
"Apache, Nginx reverse proxy")
script=temp_filler
break;;
"Nginx, PHP-FPM")
script=temp_filler
break;;
"Quit")
exit;;
*) echo "Fout commando $REPLY";;
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
##----------------##
# 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 5 minuten."
sleep 0.5
echo "****************************"
wget $script -O Ubuntu-Domain_Installer.sh
source Ubuntu-Domain_Installer.sh
echo "Installatie geslaagd!"