CFG_SETUP_MAIL=true#Needed for Multiserver setup compatibility
CFG_SETUP_MAIL=true#Needed for Multiserver setup compatibility
CFG_SETUP_NS=true#Needed for Multiserver setup compatibility
CFG_SETUP_NS=true#Needed for Multiserver setup compatibility
# Common window dimensions
WT_HEIGHT=20
WT_WIDTH=60
WT_LIST_HEIGHT=10
echo-n-e"$IDENTATION_LVL_0${BWhite}Gathering informations about softwares and versions:${NC} "
echo-n-e"$IDENTATION_LVL_0${BWhite}Gathering informations about softwares and versions:${NC} "
echo
echo
if[[!"$CFG_SSL_NEW"=~ $RE]];then
if[[!"$CFG_SSL_NEW"=~ $RE]];then
if(whiptail --title"SSL"--backtitle"$WT_BACKTITLE"--yesno"Generate new ssl or used last gerated ssl?" 10 60)then
if(whiptail --title"SSL"--backtitle"$WT_BACKTITLE"--yesno"Generate new ssl or used last gerated ssl?"$WT_HEIGHT$WT_WIDTH)then
CFG_SSL_NEW=yes
CFG_SSL_NEW=yes
else
else
CFG_SSL_NEW=no
CFG_SSL_NEW=no
fi
fi
fi
fi
while[[!"$CFG_SQLSERVER"=~ $RE]]
while[[!"$CFG_SQLSERVER"=~ $RE]];do
do
CFG_SQLSERVER=$(whiptail --title"SQL Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Please select SQL Server type"$WT_HEIGHT$WT_WIDTH 2 "MariaDB""(default)" ON "MySQL""" OFF 3>&1 1>&2 2>&3)
CFG_SQLSERVER=$(whiptail --title"SQL Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Please select SQL Server type" 10 50 2 "MariaDB""(default)" ON "MySQL""" OFF 3>&1 1>&2 2>&3)
CFG_WEBSERVER=$(whiptail --title"Web server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Please select Web server type"$WT_HEIGHT$WT_WIDTH 2 "Nginx""(default)" ON "Apache""" OFF 3>&1 1>&2 2>&3)
CFG_WEBSERVER=$(whiptail --title"Web server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Please select Web server type" 10 50 2 "Nginx""(default)" ON "Apache""" OFF 3>&1 1>&2 2>&3)
CFG_FTP=$(whiptail --title"FTP Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Install and configure FTP SERVER?"$WT_HEIGHT$WT_WIDTH 4 "onlyFTP""Yes, only with FTP" OFF "onlyTLS""Yes, only with TLS" ON "FTPandTLS""Yes, with FTP and TLS" OFF "none""No, don't install it" OFF 3>&1 1>&2 2>&3)
"Install and configure FTP SERVER ?" 10 60 4 \
"onlyFTP""Yes, only with FTP" OFF \
"onlyTLS""Yes, only with TLS" ON \
"FTPandTLS""Yes, with FTP and TLS" OFF \
"none""No, don't install it" OFF 3>&1 1>&2 2>&3)
done
done
echo-n-e"$IDENTATION_LVL_1${BBlack}Install and Configure FTP Server${NC}: ${green}$CFG_FTP${NC} "
echo-n-e"$IDENTATION_LVL_1${BBlack}Install and Configure FTP Server${NC}: ${green}$CFG_FTP${NC} "
echo
echo
while[[!"$CFG_MTA"=~ $RE]]
while[[!"$CFG_MTA"=~ $RE]];do
do
CFG_MTA=$(whiptail --title"Mail Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Select mailserver type"$WT_HEIGHT$WT_WIDTH 3 "None""" OFF "Dovecot""(default)" ON "Courier""" OFF 3>&1 1>&2 2>&3)
CFG_WEBMAIL=$(whiptail --title"Webmail client"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Select which Web Mail client you want"$WT_HEIGHT$WT_WIDTH 6 "Roundcube""(default)" OFF "Roundcube-latest""latest available" ON "RainLoop""" OFF "SOGo""" OFF "Squirrelmail""" OFF "None""No Web Mail Client" OFF 3>&1 1>&2 2>&3)
if(whiptail --title"Mailman"--backtitle"$WT_BACKTITLE"--yesno"Would you like to install Mailman?" 10 60)then
if(whiptail --title"Mailman"--backtitle"$WT_BACKTITLE"--yesno"Would you like to install Mailman?"$WT_HEIGHT$WT_WIDTH);then
CFG_MAILMAN=yes
CFG_MAILMAN=yes
echo-n-e"$IDENTATION_LVL_2${BBlack}Retrieve Mailman site password${NC}: "
echo-n-e"$IDENTATION_LVL_2${BBlack}Retrieve Mailman site password${NC}: "
MMSITEPASS=$(whiptail --title"Mailman Site Password"--backtitle"$WT_BACKTITLE"--inputbox\
MMSITEPASS=$(whiptail --title"Mailman Site Password"--backtitle"$WT_BACKTITLE"--inputbox"Please specify a Mailman Site Password (leave empty for autogenerate)"--nocancel$WT_HEIGHT$WT_WIDTH 3>&1 1>&2 2>&3)
"Please specify a Mailman Site Password (leave empty for autogenerate)"--nocancel 10 60 3>&1 1>&2 2>&3)
MMLISTOWNER=$(whiptail --title"Mailman Site List Owner"--backtitle"$WT_BACKTITLE"--inputbox"Please specify the Mailman site list owner"--nocancel$WT_HEIGHT$WT_WIDTH"$USER" 3>&1 1>&2 2>&3)
MMLISTOWNER=$(whiptail --title"Mailman Site List Owner"--backtitle"$WT_BACKTITLE"--inputbox"Please specify the Mailman site list owner"--nocancel 10 60 "$USER" 3>&1 1>&2 2>&3)
done
done
while[[!"$MMADMINEMAIL"=~ $RE]]
while[[!"$MMADMINEMAIL"=~ $RE]];do
do
MMADMINEMAIL=$(whiptail --title"Mailman Admin e-mail"--backtitle"$WT_BACKTITLE"--inputbox"Please specify the Mailman site list owner"--nocancel$WT_HEIGHT$WT_WIDTH"mailman@$CFG_HOSTNAME_DOMAIN" 3>&1 1>&2 2>&3)
MMADMINEMAIL=$(whiptail --title"Mailman Admin e-mail"--backtitle"$WT_BACKTITLE"--inputbox"Please specify the Mailman site list owner"--nocancel 10 60 "mailman@$CFG_HOSTNAME_DOMAIN" 3>&1 1>&2 2>&3)
done
done
echo-n-e"$IDENTATION_LVL_2${BBlack}Retrieve Mailman site list password${NC}: "
echo-n-e"$IDENTATION_LVL_2${BBlack}Retrieve Mailman site list password${NC}: "
MMLISTPASS=$(whiptail --title"Mailman Site List Password"--backtitle"$WT_BACKTITLE"--inputbox\
MMLISTPASS=$(whiptail --title"Mailman Site List Password"--backtitle"$WT_BACKTITLE"--inputbox"Please specify a Mailman Site List Password (leave empty for autogenerate)"--nocancel$WT_HEIGHT$WT_WIDTH 3>&1 1>&2 2>&3)
"Please specify a Mailman Site List Password (leave empty for autogenerate)"--nocancel 10 60 3>&1 1>&2 2>&3)
CFG_PHPMYADMIN=$(whiptail --title"Install phpMyAdmin"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to install phpMyAdmin?"$WT_HEIGHT$WT_WIDTH 2 "Yes""(default)" ON "No""" OFF 3>&1 1>&2 2>&3)
CFG_PHPMYADMIN_VERSION=$(whiptail --title"phpMyAdmin Version"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"What version of phpMyAdmin do you want to install?"$WT_HEIGHT$WT_WIDTH 4 "Default""Current OS Version" OFF "Buster""From buster backports - newer" OFF "Bullseye""From bullseye backports - newer" OFF "Latest-stable""from phpMyAdmin.net" ON 3>&1 1>&2 2>&3)
"What version of phpMyAdmin do you want to install?" 15 75 4 \
"Default""Current OS Version" OFF \
"Buster""From buster backports - newer" OFF \
"Bullseye""From bullseye backports - newer" OFF \
"Latest-stable""from phpMyAdmin.net" ON 3>&1 1>&2 2>&3)
CFG_METRONOME=$(whiptail --title"Metronome IM"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to install Metronome XMPP Chat server?"$WT_HEIGHT$WT_WIDTH 2 "No""(default)" ON "Yes""" OFF 3>&1 1>&2 2>&3)
#if (whiptail --title "DNS (bind9)" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install DNS server (bind9)?" --defaultno 10 60); then
#CFG_BIND=true
#else
#CFG_BIND=false
#CFG_SETUP_NS=false
#fi
#echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install DNS server (bind9)${NC}: ${green}$CFG_JKIT${NC} "
#echo
#while [ "x$CFG_JOOMLA" == "x" ]
#while [ "x$CFG_JOOMLA" == "x" ]
#do
#do
# CFG_JOOMLA=$(whiptail --title "Install CMS" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select the default CMS" 10 50 2 "joomla" "(default)" ON "drupal" "" OFF 3>&1 1>&2 2>&3)
# CFG_JOOMLA=$(whiptail --title "Install CMS" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select the default CMS" 10 50 2 "joomla" "(default)" ON "drupal" "" OFF 3>&1 1>&2 2>&3)
#done
#done
while["x$CFG_GITLABINSTALL"=="x"]
do
while["x$CFG_GITLABINSTALL"=="x"];do
CFG_GITLABINSTALL=$(whiptail --title"Install Gitlab Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to install Gitlab Server?" 10 60 2 "yes""(default)" ON "no""" OFF 3>&1 1>&2 2>&3)
CFG_GITLABINSTALL=$(whiptail --title"Install Gitlab Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to install Gitlab Server?"$WT_HEIGHT$WT_WIDTH 2 "yes""(default)" ON "no""" OFF 3>&1 1>&2 2>&3)
CFG_CLOUDINSTALL=$(whiptail --title"Install Cloud Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to install a Cloud Server?"$WT_HEIGHT$WT_WIDTH 2 "yes""(default)" ON "no""" OFF 3>&1 1>&2 2>&3)
CFG_CLOUDINSTALL=$(whiptail --title"Install Cloud Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to install a Cloud Server?" 10 60 2 "yes""(default)" ON "no""" OFF 3>&1 1>&2 2>&3)
done
done
if["$CFG_CLOUDINSTALL"=="yes"];then
if["$CFG_CLOUDINSTALL"=="yes"];then
while["x$CFG_CLOUDTYPE"=="x"]
while["x$CFG_CLOUDTYPE"=="x"];do
do
CFG_CLOUDTYPE=$(whiptail --title"Select Cloud Server Type"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Which cloud server would you like to install?"$WT_HEIGHT$WT_WIDTH 2 "nextcloud""Nextcloud Server" ON "seafile""Seafile Server" OFF 3>&1 1>&2 2>&3)
CFG_CLOUDTYPE=$(whiptail --title"Select Cloud Server Type"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Which cloud server would you like to install?" 10 60 2 "nextcloud""Nextcloud Server" ON "seafile""Seafile Server" OFF 3>&1 1>&2 2>&3)
done
done
if["$CFG_CLOUDTYPE"=="nextcloud"];then
if["$CFG_CLOUDTYPE"=="nextcloud"];then
while["x$CFG_CLOUDUPGRADE"=="x"]
while["x$CFG_CLOUDUPGRADE"=="x"];do
do
CFG_CLOUDUPGRADE=$(whiptail --title"Install Or Upgrade Nextcloud Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to upgrade Owncloud to Nextcloud Server or Fresh install?"$WT_HEIGHT$WT_WIDTH 2 "yes""(Upgrade)" OFF "no""(Fresh install)" ON 3>&1 1>&2 2>&3)
CFG_CLOUDUPGRADE=$(whiptail --title"Install Or Upgrade Nextcloud Server"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Do you want to upgrade Owncloud to Nextcloud Server or Fresh install?" 10 60 2 "yes""(Upgrade)" OFF "no""(Fresh install)" ON 3>&1 1>&2 2>&3)
done
done
fi
fi
if["$CFG_CLOUDTYPE"=="seafile"];then
if["$CFG_CLOUDTYPE"=="seafile"];then
while["x$CFG_SEAFILEVERSION"=="x"]
while["x$CFG_SEAFILEVERSION"=="x"];do
do
CFG_SEAFILEVERSION=$(whiptail --title"Seafile Version"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Which Seafile version would you like to install?"$WT_HEIGHT$WT_WIDTH 2 "pro""Seafile Pro" OFF "community""Seafile Community Edition" ON 3>&1 1>&2 2>&3)
CFG_SEAFILEVERSION=$(whiptail --title"Seafile Version"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Which Seafile version would you like to install?" 10 60 2 "pro""Seafile Pro" OFF "community""Seafile Community Edition" ON 3>&1 1>&2 2>&3)
done
done
fi
fi
while["x$CFG_CLOUDDBTYPE"=="x"]
while["x$CFG_CLOUDDBTYPE"=="x"];do
do
CFG_CLOUDDBTYPE=$(whiptail --title"$CFG_CLOUDTYPE Database Type"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Select database type for $CFG_CLOUDTYPE:"$WT_HEIGHT$WT_WIDTH 2 "mysql""(default)" ON "sqlite""" OFF 3>&1 1>&2 2>&3)
CFG_CLOUDDBTYPE=$(whiptail --title"$CFG_CLOUDTYPE Database Type"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Select database type for $CFG_CLOUDTYPE:" 10 60 2 "mysql""(default)" ON "sqlite""" OFF 3>&1 1>&2 2>&3)
done
done
while[[!"$CFG_CLOUDDBHOST"=~ $RE]]
while[[!"$CFG_CLOUDDBHOST"=~ $RE]];do
do
CFG_CLOUDDBHOST=$(whiptail --title"$CFG_CLOUDTYPE DB host"--backtitle"$WT_BACKTITLE"--inputbox"$CFG_CLOUDTYPE database host - (default localhost) or (ext. host)"--nocancel$WT_HEIGHT$WT_WIDTH"localhost" 3>&1 1>&2 2>&3)
CFG_CLOUDDBHOST=$(whiptail --title"$CFG_CLOUDTYPE DB host"--backtitle"$WT_BACKTITLE"--inputbox"$CFG_CLOUDTYPE database host - (default localhost) or (ext. host)"--nocancel 10 60 "localhost" 3>&1 1>&2 2>&3)
CFG_ISPC=$(whiptail --title"ISPConfig Setup"--backtitle"$WT_BACKTITLE"--nocancel--radiolist"Would you like full unattended setup of expert mode for ISPConfig?"$WT_HEIGHT$WT_WIDTH 2 "standard""Yes (default)" ON "expert""No, I want to configure" OFF 3>&1 1>&2 2>&3)
CFG_ISPONCFIG_PORT=$(whiptail --title"ISPConfig"--backtitle"$WT_BACKTITLE"--inputbox"Please specify an ISPConfig Port (leave empty for use 8888 port)"--nocancel$WT_HEIGHT$WT_WIDTH 3>&1 1>&2 2>&3)
"Please specify a ISPConfig Port (leave empty for use 8888 port)"--nocancel 10 60 3>&1 1>&2 2>&3)
CFG_ISPONCFIG_APPS_PORT=$(whiptail --title"ISPConfig"--backtitle"$WT_BACKTITLE"--inputbox"Please specify an ISPConfig Apps Port (leave empty for use 8083 port)"--nocancel$WT_HEIGHT$WT_WIDTH 3>&1 1>&2 2>&3)
"Please specify a ISPConfig Apps Port (leave empty for use 8083 port)"--nocancel 10 60 3>&1 1>&2 2>&3)
echo-n-e"$IDENTATION_LVL_2${BBlack}Retrieve ISPConfig DB password${NC}: "
echo-n-e"$IDENTATION_LVL_2${BBlack}Retrieve ISPConfig DB password${NC}: "
CFG_ISPCONFIG_DB_PASS=$(whiptail --title"ISPConfig DB Password"--backtitle"$WT_BACKTITLE"--inputbox\
CFG_ISPCONFIG_DB_PASS=$(whiptail --title"ISPConfig DB Password"--backtitle"$WT_BACKTITLE"--inputbox"Please specify an ISPConfig DB Password (leave empty for autogenerate)"--nocancel$WT_HEIGHT$WT_WIDTH 3>&1 1>&2 2>&3)
"Please specify a ISPConfig DB Password (leave empty for autogenerate)"--nocancel 10 60 3>&1 1>&2 2>&3)
SSL_STATE=$(whiptail --title"SSL State or Province Name"--backtitle"$WT_BACKTITLE"--inputbox"SSL Configuration - STATE or Province Name (full name - ex. Hungary)"--nocancel 10 60"Hungary" 3>&1 1>&2 2>&3)
SSL_STATE=$(whiptail --title"SSL State or Province Name"--backtitle"$WT_BACKTITLE"--inputbox"SSL Configuration - STATE or Province Name (full name - ex. Hungary)"--nocancel$WT_HEIGHT$WT_WIDTH"Hungary" 3>&1 1>&2 2>&3)
echo-n-e"$IDENTATION_LVL_1 Installing dbconfig-common and fixing RoundCube... "
echo-n-e"$IDENTATION_LVL_1 Installing dbconfig-common and fixing RoundCube... "
package_install dbconfig-common dbconfig-mysql
apt_install dbconfig-common dbconfig-mysql
#There is currently a problem with the Debian dbconfig-common system which prevents the installation of RoundCube later, fix it by running this command:
#There is currently a problem with the Debian dbconfig-common system which prevents the installation of RoundCube later, fix it by running this command: