From ac8f6ad476bc911e76f0c9f924c843c2b43a3374 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 11 Mar 2020 10:56:03 +0100 Subject: [PATCH] Update 'installer.sh' --- installer.sh | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/installer.sh b/installer.sh index 3173776..eaaff3f 100644 --- a/installer.sh +++ b/installer.sh @@ -186,6 +186,11 @@ fi webserv="${webserv//:}" && webserv="${webserv,,}" +echo "Generating apt list for Generic" +curl "$repo"/raw/branch/"$branch"/CoreModules/generic/apt.list >>/tmp/apt.list +printf " " >>/tmp/apt.list + +echo "Generating apt list for Webserver" curl "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list @@ -389,9 +394,10 @@ $PKGM upgrade -y # Pre-configuring # ##-------------------## +echo "Running preconf for generic" +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/preconf.sh) + echo "Running preconf for Webserv" - - if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh) fi @@ -444,9 +450,10 @@ cat /tmp/apt.list | xargs $PKGI # Configuring # ##---------------## +echo "Running conf for generic" +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/conf.sh) echo "Running conf for Webserv" - if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh) fi @@ -508,33 +515,6 @@ if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$re source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/Backend/"$webserv"-conf.sh) fi -##------------## -# Fail2Ban # -##------------## - -sed -i 's/root@localhost/'$email'/g' /etc/fail2ban/jail.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/sshd.local -O /etc/fail2ban/jail.d/sshd.local -if [[ $CMS == "Nextcloud" ]]; then -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/nextcloud.conf -O /etc/fail2ban/filter.d/nextcloud.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/nextcloud.local -O /etc/fail2ban/jail.d/nextcloud.local -fi -if [[ $CMS == "Wordpress" ]]; then -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/wordpress.conf -O /etc/fail2ban/filter.d/wordpress.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/wordpress.local -O /etc/fail2ban/jail.d/wordpress.local -fi - - -##-------## -# UFW # -##-------## - -sed -i '/IPV6=/c\IPV6=yes' /etc/default/ufw -ufw default deny incoming > $OUTPUT 2>&1 -ufw default allow outgoing > $OUTPUT 2>&1 -ufw allow 80/tcp > $OUTPUT 2>&1 -ufw allow 443/tcp > $OUTPUT 2>&1 -ufw limit 4242/tcp > $OUTPUT 2>&1 -echo "y" | ufw enable > $OUTPUT 2>&1 ##------------## # Services #