|
| 1 | +#--------------------------------------------------------------------- |
| 2 | +# Function: AskQuestions Ubuntu 16.04 |
| 3 | +# Ask for all needed user input |
| 4 | +#--------------------------------------------------------------------- |
| 5 | +AskQuestions() { |
| 6 | + echo "Installing pre-required packages" |
| 7 | + [ -f /bin/whiptail ] && echo -e "whiptail found: ${green}OK${NC}\n" || apt-get -y install whiptail > /dev/null 2>&1 |
| 8 | + |
| 9 | + while [ "x$CFG_SQLSERVER" == "x" ] |
| 10 | + do |
| 11 | + CFG_SQLSERVER=$(whiptail --title "SQLSERVER" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select SQL Server type" 10 50 2 "MySQL" "(default)" ON "MariaDB" "" OFF 3>&1 1>&2 2>&3) |
| 12 | + done |
| 13 | + |
| 14 | + while [ "x$CFG_MYSQL_ROOT_PWD" == "x" ] |
| 15 | + do |
| 16 | + CFG_MYSQL_ROOT_PWD=$(whiptail --title "MySQL" --backtitle "$WT_BACKTITLE" --inputbox "Please specify a root password" --nocancel 10 50 3>&1 1>&2 2>&3) |
| 17 | + done |
| 18 | + |
| 19 | + while [ "x$CFG_WEBSERVER" == "x" ] |
| 20 | + do |
| 21 | + CFG_WEBSERVER=$(whiptail --title "WEBSERVER" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select webserver type" 10 50 2 "apache" "(default)" ON "nginx" "" OFF 3>&1 1>&2 2>&3) |
| 22 | + done |
| 23 | + |
| 24 | + while [ "x$CFG_XCACHE" == "x" ] |
| 25 | + do |
| 26 | + CFG_XCACHE=$(whiptail --title "Install XCache" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "You want to install XCache during install? ATTENTION: If XCache is installed, Ioncube Loaders will not work !!" 20 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3) |
| 27 | + done |
| 28 | + |
| 29 | + while [ "x$CFG_PHPMYADMIN" == "x" ] |
| 30 | + do |
| 31 | + CFG_PHPMYADMIN=$(whiptail --title "Install phpMyAdmin" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "You want to install phpMyAdmin during install?" 10 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3) |
| 32 | + done |
| 33 | + |
| 34 | + while [ "x$CFG_MTA" == "x" ] |
| 35 | + do |
| 36 | + CFG_MTA=$(whiptail --title "Mail Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select mailserver type" 10 50 2 "dovecot" "(default)" ON "courier" "" OFF 3>&1 1>&2 2>&3) |
| 37 | + done |
| 38 | + |
| 39 | + while [ "x$CFG_HHVMINSTALL" == "x" ] |
| 40 | + do |
| 41 | + CFG_HHVMINSTALL=$(whiptail --title "Install HHVM" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install HHVM?" 10 50 2 "yes" "" OFF "no""(default)" ON 3>&1 1>&2 2>&3) |
| 42 | + done |
| 43 | + |
| 44 | + while [ "x$CFG_METRONOM" == "x" ] |
| 45 | + do |
| 46 | + CFG_METRONOM=$(whiptail --title "Install Metronom XMPP Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install Metronom XMPP Server?" 10 50 2 "yes" "" OFF "no""(default)" ON 3>&1 1>&2 2>&3) |
| 47 | + done |
| 48 | + |
| 49 | + while [ "x$CFG_AVUPDATE" == "x" ] |
| 50 | + do |
| 51 | + CFG_AVUPDATE=$(whiptail --title "Update Freshclam DB" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "You want to update Antivirus Database during install?" 10 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3) |
| 52 | + done |
| 53 | + |
| 54 | + if (whiptail --title "Quota" --backtitle "$WT_BACKTITLE" --yesno "Setup user quota?" 10 50) then |
| 55 | + CFG_QUOTA=yes |
| 56 | + else |
| 57 | + CFG_QUOTA=no |
| 58 | + fi |
| 59 | + |
| 60 | + while [ "x$CFG_ISPC" == "x" ] |
| 61 | + do |
| 62 | + CFG_ISPC=$(whiptail --title "ISPConfig Setup" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Would you like full unattended setup of expert mode for ISPConfig?" 10 50 2 "standard" "(default)" ON "expert" "" OFF 3>&1 1>&2 2>&3) |
| 63 | + done |
| 64 | + |
| 65 | + if (whiptail --title "Jailkit" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Jailkit?" 10 50) then |
| 66 | + CFG_JKIT=yes |
| 67 | + else |
| 68 | + CFG_JKIT=no |
| 69 | + fi |
| 70 | + |
| 71 | + CFG_WEBMAIL=squirrelmail |
| 72 | + |
| 73 | + SSL_COUNTRY=$(whiptail --title "SSL Country" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Country (ex. EN)" --nocancel 10 50 3>&1 1>&2 2>&3) |
| 74 | + SSL_STATE=$(whiptail --title "SSL State" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - STATE (ex. Italy)" --nocancel 10 50 3>&1 1>&2 2>&3) |
| 75 | + SSL_LOCALITY=$(whiptail --title "SSL Locality" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Locality (ex. Udine)" --nocancel 10 50 3>&1 1>&2 2>&3) |
| 76 | + SSL_ORGANIZATION=$(whiptail --title "SSL Organization" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization (ex. Company L.t.d.)" --nocancel 10 50 3>&1 1>&2 2>&3) |
| 77 | + SSL_ORGUNIT=$(whiptail --title "SSL Organization Unit" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization Unit (ex. IT Department)" --nocancel 10 50 3>&1 1>&2 2>&3) |
| 78 | + |
| 79 | +} |
| 80 | + |
0 commit comments