Update 'installer.sh'

This commit is contained in:
bprieshof
2019-12-05 10:41:52 +01:00
parent 8cf4e8db84
commit d77c939412

View File

@@ -198,15 +198,17 @@ option="${option// /}" && option="${option/:/ }" && option="${option//:}" && opt
echo "Generating Apt List for options" echo "Generating Apt List for options"
for val1 in ${option[*]}; do for val1 in ${option[*]}; do
echo $val1 #TMP echo $val1 #TMP
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"/apt.list >>/tmp/apt.list if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/common/apt.list >>/tmp/apt.list curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list
fi
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list
done done
##-------## ##-------##
# CMS # # CMS #
##-------## ##-------##
if [ $IMODE = n ]; then if [ $IMODE = n ]; then
CMS=$(whiptail --nocancel --title "What CMS should be installed?" --radiolist "Features" 11 118 5 "Nextcloud:" "Nextcloud is a suite of client-server software for creating and using file hosting services." OFF "Wordpress:" "WordPress is a content management system based on PHP." OFF "None:" "A plain webserver will be setup." OFF 3>&1 1>&2 2>&3) CMS=$(whiptail --nocancel --title "What CMS should be installed?" --radiolist "Features" 11 118 5 "Nextcloud:" "Nextcloud is a suite of client-server software for creating and using file hosting services." OFF "Wordpress:" "WordPress is a content management system based on PHP." OFF "None:" "A plain webserver will be setup." OFF 3>&1 1>&2 2>&3)
fi fi
@@ -232,13 +234,19 @@ break;;
esac esac
done done
fi fi
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/$webserv/apt.list >>/tmp/apt.list
echo "Generating Apt List for CMS"
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list
fi
##--------------------## ##--------------------##
# Pre-Requirements # # Pre-Requirements #
##--------------------## ##--------------------##
sed -i '/Port 22/c\Port 4242' /etc/ssh/sshd_config sed -i '/Port 22/c\Port 4242' /etc/ssh/sshd_config
msg "Preconfiguring." msg "Preconfiguring."
@@ -252,9 +260,34 @@ $PKGM update
$PKGM upgrade -y $PKGM upgrade -y
##-------------------##
# Pre-configuring #
##-------------------##
echo "Running preconf for Webserv"
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh)
echo "Running preconf for Options"
for val1 in ${option[*]}; do
echo $val1 #TMP
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh)
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh)
fi
done
echo "Running preconf for CMS"
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh)
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh)
fi
##-------------## ##-------------##
# Installer # # Installer #
##-------------## ##-------------##
sed -i 's/PHPver/'$phpver'/g' /tmp/apt.list sed -i 's/PHPver/'$phpver'/g' /tmp/apt.list
cat /tmp/apt.list | xargs $PKGI cat /tmp/apt.list | xargs $PKGI
@@ -263,8 +296,24 @@ cat /tmp/apt.list | xargs $PKGI
# Configuring # # Configuring #
##---------------## ##---------------##
if [[ $ModName == "1" ]]; then
source <(curl -s "$repo"/raw/branch/"$branch"/modules/MODNAME/"$webserv"-config.sh) echo "Running preconf for Webserv"
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh)
echo "Running preconf for Options"
for val1 in ${option[*]}; do
echo $val1 #TMP
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh)
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh)
fi
done
echo "Running preconf for CMS"
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh)
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
fi fi