Added legacy menu and apt.list generator for options
This commit is contained in:
131
installer.sh
131
installer.sh
@@ -76,6 +76,25 @@ echo "Please enter your password (should contain at least 2 digits and 6 charact
|
|||||||
read password
|
read password
|
||||||
echo "Administrator E-mail:"
|
echo "Administrator E-mail:"
|
||||||
read email
|
read email
|
||||||
|
|
||||||
|
echo "Select Webserver:"
|
||||||
|
PS3='Selected:'
|
||||||
|
options=("Nginx" "Apache" "Quit")
|
||||||
|
select opt in "${options[@]}"
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
"Nginx")
|
||||||
|
webserv=Nginx:
|
||||||
|
break;;
|
||||||
|
"Apache")
|
||||||
|
webserv=Apache:
|
||||||
|
break;;
|
||||||
|
"Quit")
|
||||||
|
exit;;
|
||||||
|
*) echo "$REPLY is not a valid option!";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
webserv="${webserv//:}" && webserv="${webserv,,}"
|
webserv="${webserv//:}" && webserv="${webserv,,}"
|
||||||
@@ -97,7 +116,41 @@ if [ $IMODE = n ]; then
|
|||||||
option=$(whiptail --nocancel --title "Which Nginx addons should be installed?" --checklist "Features" 11 110 5 "Memcached:" "Memcached is an open source, high-performance, distributed memory caching system." OFF "Redis Cache:" "Redis is an open source BSD licensed, in-memory data structure store." OFF 3>&1 1>&2 2>&3)
|
option=$(whiptail --nocancel --title "Which Nginx addons should be installed?" --checklist "Features" 11 110 5 "Memcached:" "Memcached is an open source, high-performance, distributed memory caching system." OFF "Redis Cache:" "Redis is an open source BSD licensed, in-memory data structure store." OFF 3>&1 1>&2 2>&3)
|
||||||
fi
|
fi
|
||||||
if [ $IMODE = l ]; then
|
if [ $IMODE = l ]; then
|
||||||
#L mode selector option
|
choice () {
|
||||||
|
local choice=$1
|
||||||
|
if [[ ${opts[choice]} ]] # toggle
|
||||||
|
then
|
||||||
|
opts[choice]=
|
||||||
|
else
|
||||||
|
opts[choice]=+
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
PS3='Which Nginx addons should be installed?'
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
clear
|
||||||
|
options=("Memcached ${opts[1]}" "Redis Cache ${opts[2]}" "Done")
|
||||||
|
select opt in "${options[@]}"
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
"Memcached ${opts[1]}")
|
||||||
|
choice 1
|
||||||
|
option="$option Memcache:"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
"Redis Cache ${opts[2]}")
|
||||||
|
choice 2
|
||||||
|
option="$option Redis Cache:"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
"Done")
|
||||||
|
break 2
|
||||||
|
;;
|
||||||
|
*) printf '%s\n' 'invalid option';;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -107,24 +160,53 @@ if [ $IMODE = n ]; then
|
|||||||
option=$(whiptail --nocancel --title "Which Apache addons should be installed?" --checklist "Features" 11 110 5 "Memcached:" "Memcached is an open source, high-performance, distributed memory caching system." OFF "Redis Cache:" "Redis is an open source BSD licensed, in-memory data structure store." OFF 3>&1 1>&2 2>&3)
|
option=$(whiptail --nocancel --title "Which Apache addons should be installed?" --checklist "Features" 11 110 5 "Memcached:" "Memcached is an open source, high-performance, distributed memory caching system." OFF "Redis Cache:" "Redis is an open source BSD licensed, in-memory data structure store." OFF 3>&1 1>&2 2>&3)
|
||||||
fi
|
fi
|
||||||
if [ $IMODE = l ]; then
|
if [ $IMODE = l ]; then
|
||||||
#L mode selector option
|
choice () {
|
||||||
|
local choice=$1
|
||||||
|
if [[ ${opts[choice]} ]] # toggle
|
||||||
|
then
|
||||||
|
opts[choice]=
|
||||||
|
else
|
||||||
|
opts[choice]=+
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
PS3='Which Apache addons should be installed?'
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
clear
|
||||||
|
options=("Memcached ${opts[1]}" "Redis Cache ${opts[2]}" "Done")
|
||||||
|
select opt in "${options[@]}"
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
"Memcached ${opts[1]}")
|
||||||
|
choice 1
|
||||||
|
option="$option Memcache:"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
"Redis Cache ${opts[2]}")
|
||||||
|
choice 2
|
||||||
|
option="$option Redis Cache:"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
"Done")
|
||||||
|
break 2
|
||||||
|
;;
|
||||||
|
*) printf '%s\n' 'invalid option';;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
option="${option// /}" && option="${option/:/ }" && option="${option//:}" && option="${option,,}" && option="${option//'"'}"
|
option="${option// /}" && option="${option/:/ }" && option="${option//:}" && option="${option,,}" && option="${option//'"'}"
|
||||||
|
|
||||||
if [[ $option == *"Memcached:"* ]]; then
|
echo "Generating Apt List for options"
|
||||||
#curl -s "$repo"/raw/branch/"$branch"/modules/MODNAME/"$webserv"-aptlist >> /tmp/install.txt
|
for val1 in ${option[*]}; do
|
||||||
echo "php-memcached" >> /tmp/install.txt
|
echo $val1 #TMP
|
||||||
fi
|
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"/apt.list >>/tmp/apt.list
|
||||||
|
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/common/apt.list >>/tmp/apt.list
|
||||||
|
|
||||||
if [[ $option == *"Redis"* ]]; then
|
done
|
||||||
echo "redis-server" >> /tmp/install.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $option == *"Brotli:"* ]]; then
|
|
||||||
echo "" >> /tmp/install.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
##-------##
|
##-------##
|
||||||
@@ -135,8 +217,29 @@ CMS=$(whiptail --nocancel --title "What CMS should be installed?" --radiolist "F
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $IMODE = l ]; then
|
if [ $IMODE = l ]; then
|
||||||
#L mode selector for CMS
|
echo "What CMS should be installed?"
|
||||||
|
PS3='Selected:'
|
||||||
|
options=("Nextcloud" "Wordpress" "None")
|
||||||
|
select opt in "${options[@]}"
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
"Nextcloud")
|
||||||
|
CMS=Nextcloud:
|
||||||
|
break;;
|
||||||
|
"Wordpress")
|
||||||
|
CMS=Wordpress:
|
||||||
|
break;;
|
||||||
|
"None")
|
||||||
|
CMS=None:
|
||||||
|
break;;
|
||||||
|
|
||||||
|
*) echo "$REPLY is not a valid option!";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/$webserv/apt.list >>/tmp/apt.list
|
||||||
|
|
||||||
|
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list
|
||||||
|
|
||||||
if [[ $CMS == "Nextcloud:" ]]; then
|
if [[ $CMS == "Nextcloud:" ]]; then
|
||||||
echo "libxml2 openssl zlib1g libpng-dev redis-server" >> /tmp/install.txt
|
echo "libxml2 openssl zlib1g libpng-dev redis-server" >> /tmp/install.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user