From 5823d9e01cb076977c240e1349bbeba30022344d Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 8 Apr 2020 16:24:14 +0200 Subject: [PATCH] menu and var changes enabled external menu entry list and made vars reddy for use external of this srcipt --- installer.sh | 57 +++++++++------------------------------------------- 1 file changed, 10 insertions(+), 47 deletions(-) diff --git a/installer.sh b/installer.sh index d10f333..62cc9a6 100644 --- a/installer.sh +++ b/installer.sh @@ -53,56 +53,14 @@ domainwww=0 fi -##----------------## -# Menu Entries # -##----------------## - -if [ $IMODE = n ]; then -#WebServers -webservers=("Nginx:" "Will install NGINX Webserver." ON) -webservers+=("Apache:" "Will install Apache Webserver." OFF) - -##Nginx -#CMSList -NginxCMSL=("None:" "A plain webserver will be setup." OFF) -NginxCMSL+=("Wordpress:" "WordPress is a content management system based on PHP." OFF) -NginxCMSL+=("Nextcloud:" "Nextcloud is a suite of client-server software for creating and using file hosting services." OFF) -#Options -NginxOptions=("Option 1:" "Option 1 Desription" OFF) -NginxOptions+=("Option 2:" "Option 2 Desription" OFF) -NginxOptions+=("Option 3:" "Option 3 Desription" OFF) - -##Apache -#CMSList -ApacheCMSL=("None:" "A plain webserver will be setup." OFF) -ApacheCMSL+=("Wordpress:" "WordPress is a content management system based on PHP." OFF) -#Options -ApacheOptions=("Option 1:" "Option 1 Desription" OFF) -ApacheOptions+=("Option 2: " "Option 2 Desription" OFF) -fi -if [ $IMODE = l ]; then -#WebServers -webservers=("Nginx" "Apache" "Quit") -##Nginx -#CMSList -NginxCMSL=("Wordpress" "Nextcloud" "None") -#Options -NginxOptions=("Ngx Option 1:" "Ngx Option 2:" "Ngx Option 3:") - - -##Apache -#CMSList -ApacheCMSL=("Wordpress" "Nextcloud" "None") -#Options -ApacheOptions=("Apa Option 1:" "Apa Option 2:" "Apa Option 3:") -fi - ##---------------------## # Always-on modules # ##---------------------## + aonoption="/MySQL/" aonoption="$aonoption /Unattended-Security-Updates/" + ##---------------## # Functions # ##---------------## @@ -144,8 +102,6 @@ if [ -z $passdiatwo ]; then fi } - - function LegacyPasswordQuest { echo "Enter password (Requires: 8 chars, 1 capital and 1 num)" read -s passdiaone @@ -190,6 +146,9 @@ $PKGI curl > $OUTPUT 2>&1 # Menu # ##--------## +#Fetching Menu Entries +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list) + if [ $IMODE = n ]; then if [ $TestMode = 0 ]; then domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3) @@ -306,11 +265,14 @@ if [[ ${opts[choice]} ]] # toggle then opts[choice]= topt=${opt//+/} +topt="${topt%"${topt##*[![:space:]]}"}" +topt=\"$topt\" option=${option//"$topt"/} unset $topt else opts[choice]=+ -option="$option $opt" +opt="${opt%"${opt##*[![:space:]]}"}" +option+="\"$opt\" " fi } echo "The first slection will always return invalid option, please enter the first option twice" @@ -337,6 +299,7 @@ do esac done done +option="${option%"${option##*[![:space:]]}"}" fi #Cleaning options from menu