Commit 432ce64f authored by w4t's avatar w4t

wtserver 0.02

parent a4f9be0b
...@@ -3,179 +3,151 @@ ...@@ -3,179 +3,151 @@
# Ask for all needed user input # Ask for all needed user input
#--------------------------------------------------------------------- #---------------------------------------------------------------------
AskQuestions() { AskQuestions() {
START_TIME=$SECONDS START_TIME=$SECONDS
CFG_SETUP_WEB=true #Needed for Multiserver setup compatibility CFG_SETUP_WEB=true #Needed for Multiserver setup compatibility
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
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Gathering informations about softwares and versions:${NC} " # Common window dimensions
echo WT_HEIGHT=20
WT_WIDTH=60
if [[ ! "$CFG_SSL_NEW" =~ $RE ]]; then WT_LIST_HEIGHT=10
if (whiptail --title "SSL" --backtitle "$WT_BACKTITLE" --yesno "Generate new ssl or used last gerated ssl?" 10 60) then
CFG_SSL_NEW=yes echo -n -e "$IDENTATION_LVL_0 ${BWhite}Gathering informations about softwares and versions:${NC} "
else echo
CFG_SSL_NEW=no
fi if [[ ! "$CFG_SSL_NEW" =~ $RE ]]; then
fi 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
while [[ ! "$CFG_SQLSERVER" =~ $RE ]]
do
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)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve $CFG_SQLSERVER root password${NC}: "
CFG_MYSQL_ROOT_PWD=$(whiptail --title "$CFG_SQLSERVER" --backtitle "$WT_BACKTITLE" --inputbox \
"Please specify a $CFG_SQLSERVER Root Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $CFG_MYSQL_ROOT_PWD ]]; then
CFG_MYSQL_ROOT_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
while [[ ! "$CFG_WEBSERVER" =~ $RE ]]
do
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)
done
CFG_WEBSERVER=${CFG_WEBSERVER,,}
while [ "x$CFG_FTP" == "x" ]; do
CFG_FTP=$(whiptail --title "FTP Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \
"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
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install and Configure FTP Server${NC}: ${green}$CFG_FTP${NC} "
echo
while [[ ! "$CFG_MTA" =~ $RE ]]
do
CFG_MTA=$(whiptail --title "Mail Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \
"Select mailserver type" 10 60 3 \
"None" "" OFF \
"Dovecot" "(default)" ON \
"Courier" "" OFF 3>&1 1>&2 2>&3)
done
CFG_MTA=${CFG_MTA,,}
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Mail Server${NC}: ${green}$CFG_MTA${NC} "
echo
if [ $CFG_MTA == "none" ]; then
CFG_WEBMAIL="none"
CFG_SETUP_MAIL=false
else else
CFG_SETUP_MAIL=true CFG_SSL_NEW=no
while [[ ! "$CFG_WEBMAIL" =~ $RE ]]
do
CFG_WEBMAIL=$(whiptail --title "Webmail client" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \
"Select which Web Mail client you want" 10 60 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)
done
if [ $CFG_WEBMAIL != "none" ] || [ $CFG_WEBMAIL != "squirrelmail" ]; then
while [[ ! "$CFG_ROUNDCUBE_DB" =~ $RE ]]
do
CFG_ROUNDCUBE_DB=$(whiptail --title "Roundcube database name" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Roundcube database name" --nocancel 10 60 "wt_roundcube" 3>&1 1>&2 2>&3)
done
while [[ ! "$CFG_ROUNDCUBE_USR" =~ $RE ]]
do
CFG_ROUNDCUBE_USR=$(whiptail --title "Roundcube database username" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Roundcube database username" --nocancel 10 60 "wt_roundcube" 3>&1 1>&2 2>&3)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Roundcube database password${NC}: "
CFG_ROUNDCUBE_PWD=$(whiptail --title "Roundcube Database Password" --backtitle "$WT_BACKTITLE" --inputbox \
"Please specify a Roundcube Database Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $CFG_ROUNDCUBE_PWD ]]; then
CFG_ROUNDCUBE_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
while [[ ! "$CFG_ROUNDCUBE_SOAP_USR" =~ $RE ]]
do
CFG_ROUNDCUBE_SOAP_USR=$(whiptail --title "Roundcube Ispconfig3 Soap Username" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Roundcube Ispconfig3 Soap Username" --nocancel 10 60 "roundcube_soap" 3>&1 1>&2 2>&3)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Roundcube Ispconfig3 Soap Password${NC}: "
CFG_ROUNDCUBE_SOAP_PWD=$(whiptail --title "Roundcube Ispconfig3 Soap Password" --backtitle "$WT_BACKTITLE" --inputbox \
"Please specify a Roundcube Ispconfig3 Soap Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $CFG_ROUNDCUBE_SOAP_PWD ]]; then
CFG_ROUNDCUBE_SOAP_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
fi
fi
CFG_WEBMAIL=${CFG_WEBMAIL,,}
echo -n -e "$IDENTATION_LVL_1 ${BBlack}WebMail client${NC}: ${green}$CFG_WEBMAIL${NC} "
echo
if [[ ! "$CFG_MAILMAN" =~ $RE ]]; then
if (whiptail --title "Mailman" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Mailman?" 10 60) then
CFG_MAILMAN=yes
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Mailman site password${NC}: "
MMSITEPASS=$(whiptail --title "Mailman Site Password" --backtitle "$WT_BACKTITLE" --inputbox \
"Please specify a Mailman Site Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $MMSITEPASS ]]; then
MMSITEPASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
while [[ ! "$MMLISTOWNER" =~ $RE ]]
do
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
while [[ ! "$MMADMINEMAIL" =~ $RE ]]
do
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
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Mailman site list password${NC}: "
MMLISTPASS=$(whiptail --title "Mailman Site List Password" --backtitle "$WT_BACKTITLE" --inputbox \
"Please specify a Mailman Site List Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $MMLISTPASS ]]; then
MMLISTPASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
else
CFG_MAILMAN=no
fi
fi fi
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Mailman${NC}: ${green}$CFG_MAILMAN${NC} " while [[ ! "$CFG_SQLSERVER" =~ $RE ]]; do
echo 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)
done
#while [[ ! "$CFG_AVUPDATE" =~ $RE ]] echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve $CFG_SQLSERVER root password${NC}: "
#do CFG_MYSQL_ROOT_PWD=$(whiptail --title "$CFG_SQLSERVER" --backtitle "$WT_BACKTITLE" --inputbox "Please specify a $CFG_SQLSERVER Root Password (leave empty for autogenerate)" --nocancel $WT_HEIGHT $WT_WIDTH 3>&1 1>&2 2>&3)
# CFG_AVUPDATE=$(whiptail --title "Update Freshclam DB" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to update Antivirus Database?" 10 60 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3)
#done if [[ -z $CFG_MYSQL_ROOT_PWD ]]; then
if (whiptail --title "Update Freshclam DB" --backtitle "$WT_BACKTITLE" --yesno "You want to update Antivirus Database during install?" 10 60); then CFG_MYSQL_ROOT_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
CFG_AVUPDATE=true fi
else
CFG_AVUPDATE=false while [[ ! "$CFG_WEBSERVER" =~ $RE ]]; do
fi 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)
done
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Update Antivirus Database${NC}: ${green}$CFG_AVUPDATE${NC} " CFG_WEBSERVER=${CFG_WEBSERVER,,}
echo
while [ "x$CFG_FTP" == "x" ]; do
while [[ ! "$CFG_ANTISPAM" =~ $RE ]] 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)
do done
CFG_ANTISPAM=$(whiptail --title "Spam detection" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Please select the spam detection software" 10 60 2 "rspamd" "(default)" ON "amavisd" "(Amavisd+SpamAssassin)" OFF 3>&1 1>&2 2>&3)
done echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install and Configure FTP Server${NC}: ${green}$CFG_FTP${NC} "
echo
while [ "x$CFG_PHP_VERSION" == "x" ]; do
CFG_PHP_VERSION=$(whiptail --title "Choose PHP Version(s)" --backtitle "$WT_BACKTITLE" --nocancel --separate-output --checklist \ while [[ ! "$CFG_MTA" =~ $RE ]]; do
"Choose PHP Version do you want to install" 20 85 12 \ 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)
done
CFG_MTA=${CFG_MTA,,}
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Mail Server${NC}: ${green}$CFG_MTA${NC} "
echo
if [ $CFG_MTA == "none" ]; then
CFG_WEBMAIL="none"
CFG_SETUP_MAIL=false
else
CFG_SETUP_MAIL=true
while [[ ! "$CFG_WEBMAIL" =~ $RE ]]; do
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)
done
if [ $CFG_WEBMAIL != "none" ] || [ $CFG_WEBMAIL != "squirrelmail" ]; then
while [[ ! "$CFG_ROUNDCUBE_DB" =~ $RE ]]; do
CFG_ROUNDCUBE_DB=$(whiptail --title "Roundcube database name" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Roundcube database name" --nocancel $WT_HEIGHT $WT_WIDTH "wt_roundcube" 3>&1 1>&2 2>&3)
done
while [[ ! "$CFG_ROUNDCUBE_USR" =~ $RE ]]; do
CFG_ROUNDCUBE_USR=$(whiptail --title "Roundcube database username" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Roundcube database username" --nocancel $WT_HEIGHT $WT_WIDTH "wt_roundcube" 3>&1 1>&2 2>&3)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Roundcube database password${NC}: "
CFG_ROUNDCUBE_PWD=$(whiptail --title "Roundcube Database Password" --backtitle "$WT_BACKTITLE" --inputbox "Please specify a Roundcube Database Password (leave empty for autogenerate)" --nocancel $WT_HEIGHT $WT_WIDTH 3>&1 1>&2 2>&3)
if [[ -z $CFG_ROUNDCUBE_PWD ]]; then
CFG_ROUNDCUBE_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
while [[ ! "$CFG_ROUNDCUBE_SOAP_USR" =~ $RE ]]; do
CFG_ROUNDCUBE_SOAP_USR=$(whiptail --title "Roundcube Ispconfig3 Soap Username" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Roundcube Ispconfig3 Soap Username" --nocancel $WT_HEIGHT $WT_WIDTH "roundcube_soap" 3>&1 1>&2 2>&3)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Roundcube Ispconfig3 Soap Password${NC}: "
CFG_ROUNDCUBE_SOAP_PWD=$(whiptail --title "Roundcube Ispconfig3 Soap Password" --backtitle "$WT_BACKTITLE" --inputbox "Please specify a Roundcube Ispconfig3 Soap Password (leave empty for autogenerate)" --nocancel $WT_HEIGHT $WT_WIDTH 3>&1 1>&2 2>&3)
if [[ -z $CFG_ROUNDCUBE_SOAP_PWD ]]; then
CFG_ROUNDCUBE_SOAP_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
fi
fi
CFG_WEBMAIL=${CFG_WEBMAIL,,}
echo -n -e "$IDENTATION_LVL_1 ${BBlack}WebMail client${NC}: ${green}$CFG_WEBMAIL${NC} "
echo
if [[ ! "$CFG_MAILMAN" =~ $RE ]]; then
if (whiptail --title "Mailman" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Mailman?" $WT_HEIGHT $WT_WIDTH); then
CFG_MAILMAN=yes
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Mailman site password${NC}: "
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)
if [[ -z $MMSITEPASS ]]; then
MMSITEPASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
while [[ ! "$MMLISTOWNER" =~ $RE ]]; do
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)
done
while [[ ! "$MMADMINEMAIL" =~ $RE ]]; 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)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Mailman site list password${NC}: "
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)
if [[ -z $MMLISTPASS ]]; then
MMLISTPASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi
else
CFG_MAILMAN=no
fi
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Mailman${NC}: ${green}$CFG_MAILMAN${NC} "
echo
if (whiptail --title "Update Freshclam DB" --backtitle "$WT_BACKTITLE" --yesno "You want to update Antivirus Database during install?" $WT_HEIGHT $WT_WIDTH); then
CFG_AVUPDATE=true
else
CFG_AVUPDATE=false
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Update Antivirus Database${NC}: ${green}$CFG_AVUPDATE${NC} "
echo
while [[ ! "$CFG_ANTISPAM" =~ $RE ]]; do
CFG_ANTISPAM=$(whiptail --title "Spam detection" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Please select the spam detection software" $WT_HEIGHT $WT_WIDTH 2 "rspamd" "(default)" ON "amavisd" "(Amavisd+SpamAssassin)" OFF 3>&1 1>&2 2>&3)
done
while [ "x$CFG_PHP_VERSION" == "x" ]; do
CFG_PHP_VERSION=$(whiptail --title "Choose PHP Version(s)" --backtitle "$WT_BACKTITLE" --nocancel --separate-output --checklist \
"Choose PHP Version do you want to install" $WT_HEIGHT $WT_WIDTH 12 \
"php5.5" "Latest Available from 5.5" OFF \ "php5.5" "Latest Available from 5.5" OFF \
"php5.6" "Latest Available from 5.6" OFF \ "php5.6" "Latest Available from 5.6" OFF \
"php7.0" "Latest Available from 7.0" OFF \ "php7.0" "Latest Available from 7.0" OFF \
...@@ -189,252 +161,217 @@ AskQuestions() { ...@@ -189,252 +161,217 @@ AskQuestions() {
"php8.3" "Latest Available from 8.3" OFF \ "php8.3" "Latest Available from 8.3" OFF \
"php8.4" "Latest Available from 8.4" OFF \ "php8.4" "Latest Available from 8.4" OFF \
"none" "No install" ON 3>&1 1>&2 2>&3) "none" "No install" ON 3>&1 1>&2 2>&3)
done done
echo -n -e "$IDENTATION_LVL_1 ${BBlack}PHP Version(s)${NC}: ${green}" $CFG_PHP_VERSION "${NC} " echo -n -e "$IDENTATION_LVL_1 ${BBlack}PHP Version(s)${NC}: ${green}" $CFG_PHP_VERSION "${NC} "
echo echo
while [ "x$CFG_CERTBOT_VERSION" == "x" ]; do while [ "x$CFG_CERTBOT_VERSION" == "x" ]; do
CFG_CERTBOT_VERSION=$(whiptail --title "Install LetsEncrypt CertBot" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \ CFG_CERTBOT_VERSION=$(whiptail --title "Install LetsEncrypt CertBot" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select CertBot Version" $WT_HEIGHT $WT_WIDTH 3 "None" "No installation" OFF "Certbot" "Certbot" OFF "Acme.sh" "Acme.sh" ON 3>&1 1>&2 2>&3)
"Select CertBot Version" 10 60 3 \ done
"None" "No installation" OFF \
"Certbot" "Certbot" OFF \ echo -n -e "$IDENTATION_LVL_1 ${BBlack}LetsEncrypt CertBot Version${NC}: ${green}$CFG_CERTBOT_VERSION${NC} "
"Acme.sh" "Acme.sh" ON 3>&1 1>&2 2>&3) echo
done
while [[ ! "$CFG_PHPMYADMIN" =~ $RE ]]; do
echo -n -e "$IDENTATION_LVL_1 ${BBlack}LetsEncrypt CertBot Version${NC}: ${green}$CFG_CERTBOT_VERSION${NC} " 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)
echo done
while [[ ! "$CFG_PHPMYADMIN" =~ $RE ]] echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install PhpMyAdmin${NC}: ${green}$CFG_PHPMYADMIN${NC} "
do echo
CFG_PHPMYADMIN=$(whiptail --title "Install phpMyAdmin" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \
"Do you want to install phpMyAdmin?" 10 60 2 \ if [ $CFG_PHPMYADMIN == "yes" ]; then
"Yes" "(default)" ON \ while [ "x$CFG_PHPMYADMIN_VERSION" == "x" ]; do
"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)
done done
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install PhpMyAdmin${NC}: ${green}$CFG_PHPMYADMIN${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Version${NC}: ${green}$CFG_PHPMYADMIN_VERSION${NC} "
echo echo
else
if [ $CFG_PHPMYADMIN == "yes" ]; then CFG_PHPMYADMIN_VERSION='none'
while [ "x$CFG_PHPMYADMIN_VERSION" == "x" ]; do fi
CFG_PHPMYADMIN_VERSION=$(whiptail --title "phpMyAdmin Version" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \
"What version of phpMyAdmin do you want to install?" 15 75 4 \ while [[ ! "$CFG_METRONOME" =~ $RE ]]; do
"Default" "Current OS Version" OFF \ 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)
"Buster" "From buster backports - newer" OFF \ done
"Bullseye" "From bullseye backports - newer" OFF \
"Latest-stable" "from phpMyAdmin.net" ON 3>&1 1>&2 2>&3) if (whiptail --title "Quota" --backtitle "$WT_BACKTITLE" --yesno "Setup user quota?" $WT_HEIGHT $WT_WIDTH); then
done CFG_QUOTA=true
else
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Version${NC}: ${green}$CFG_PHPMYADMIN_VERSION${NC} " CFG_QUOTA=false
echo fi
else
CFG_PHPMYADMIN_VERSION='none' echo -n -e "$IDENTATION_LVL_1 ${BBlack}Setup Quota${NC}: ${green}$CFG_QUOTA${NC} "
fi echo
while [[ ! "$CFG_METRONOME" =~ $RE ]] if (whiptail --title "Jailkit" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Jailkit?" $WT_HEIGHT $WT_WIDTH); then
do CFG_JKIT=true
CFG_METRONOME=$(whiptail --title "Metronome IM" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \ else
"Do you want to install Metronome XMPP Chat server?" 10 60 2 \ CFG_JKIT=false
"No" "(default)" ON \ fi
"Yes" "" OFF 3>&1 1>&2 2>&3)
done echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install Jailkit${NC}: ${green}$CFG_JKIT${NC} "
echo
if (whiptail --title "Quota" --backtitle "$WT_BACKTITLE" --yesno "Setup user quota?" 10 60); then
CFG_QUOTA=true if (whiptail --title "WebStats" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install WebStats?" $WT_HEIGHT $WT_WIDTH); then
else CFG_WEBSTATS=true
CFG_QUOTA=false else
fi CFG_WEBSTATS=false
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Setup Quota${NC}: ${green}$CFG_QUOTA${NC} "
echo echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install WebStats${NC}: ${green}$CFG_WEBSTATS${NC} "
echo
if (whiptail --title "Jailkit" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Jailkit?" 10 60); then
CFG_JKIT=true #if (whiptail --title "DNS (bind9)" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install DNS server (bind9)?" --defaultno 10 60); then
else #CFG_BIND=true
CFG_JKIT=false #else
fi #CFG_BIND=false
#CFG_SETUP_NS=false
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install Jailkit${NC}: ${green}$CFG_JKIT${NC} " #fi
echo
#echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install DNS server (bind9)${NC}: ${green}$CFG_JKIT${NC} "
#if (whiptail --title "DNS (bind9)" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install DNS server (bind9)?" --defaultno 10 60); then #echo
# CFG_BIND=true
#else #while [ "x$CFG_JOOMLA" == "x" ]
# 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
if (whiptail --title "WebStats" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install WebStats?" 10 60); then
CFG_WEBSTATS=true
else
CFG_WEBSTATS=false
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install DNS server (bind9)${NC}: ${green}$CFG_JKIT${NC} "
echo
#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
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)
done
if [ "$CFG_GITLABINSTALL" == "yes" ]; then while [ "x$CFG_GITLABINSTALL" == "x" ]; do
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Gitlab Admin password${NC}: " 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_GITLAB_ADMIN_PWD=$(whiptail --title "Gitlab" --backtitle "$WT_BACKTITLE" --inputbox \ done
"Please specify a Gitlab Admin Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $CFG_GITLAB_ADMIN_PWD ]]; then if [ "$CFG_GITLABINSTALL" == "yes" ]; then
CFG_GITLAB_ADMIN_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29}) echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Gitlab Admin password${NC}: "
fi CFG_GITLAB_ADMIN_PWD=$(whiptail --title "Gitlab" --backtitle "$WT_BACKTITLE" --inputbox "Please specify a Gitlab Admin Password (leave empty for autogenerate)" --nocancel $WT_HEIGHT $WT_WIDTH 3>&1 1>&2 2>&3)
fi
while [ "x$CFG_CLOUDINSTALL" == "x" ] if [[ -z $CFG_GITLAB_ADMIN_PWD ]]; then
do CFG_GITLAB_ADMIN_PWD=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
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) fi
done fi
if [ "$CFG_CLOUDINSTALL" == "yes" ]; then
while [ "x$CFG_CLOUDTYPE" == "x" ]
do
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
if [ "$CFG_CLOUDTYPE" == "nextcloud" ]; then
while [ "x$CFG_CLOUDUPGRADE" == "x" ]
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?" 10 60 2 "yes" "(Upgrade)" OFF "no" "(Fresh install)" ON 3>&1 1>&2 2>&3)
done
fi
if [ "$CFG_CLOUDTYPE" == "seafile" ]; then
while [ "x$CFG_SEAFILEVERSION" == "x" ]
do
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
fi
while [ "x$CFG_CLOUDDBTYPE" == "x" ]
do
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
while [[ ! "$CFG_CLOUDDBHOST" =~ $RE ]]
do
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)
done
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install cloud server ${NC}: ${green}$CFG_CLOUDINSTALL${NC} " while [ "x$CFG_CLOUDINSTALL" == "x" ]; do
echo 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)
done
echo -n -e "$IDENTATION_LVL_1 ${BBlack}ISPConfig Configuration: ${NC}" if [ "$CFG_CLOUDINSTALL" == "yes" ]; then
echo while [ "x$CFG_CLOUDTYPE" == "x" ]; 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)
done
while [[ ! "$CFG_ISPC" =~ $RE ]] if [ "$CFG_CLOUDTYPE" == "nextcloud" ]; then
do while [ "x$CFG_CLOUDUPGRADE" == "x" ]; do
CFG_ISPC=$(whiptail --title "ISPConfig Setup" --backtitle "$WT_BACKTITLE" --nocancel --radiolist \ 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)
"Would you like full unattended setup of expert mode for ISPConfig?" 10 60 2 \ done
"standard" "Yes (default)" ON \ fi
"expert" "No, i want to configure" OFF 3>&1 1>&2 2>&3)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Install Mode${NC}: ${green}" $CFG_ISPC "${NC} " if [ "$CFG_CLOUDTYPE" == "seafile" ]; then
echo while [ "x$CFG_SEAFILEVERSION" == "x" ]; 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)
done
fi
CFG_ISPONCFIG_PORT=$(whiptail --title "ISPConfig" --backtitle "$WT_BACKTITLE" --inputbox \ while [ "x$CFG_CLOUDDBTYPE" == "x" ]; do
"Please specify a ISPConfig Port (leave empty for use 8888 port)" --nocancel 10 60 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:" $WT_HEIGHT $WT_WIDTH 2 "mysql" "(default)" ON "sqlite" "" OFF 3>&1 1>&2 2>&3)
done
if [[ -z $CFG_ISPONCFIG_PORT ]]; then while [[ ! "$CFG_CLOUDDBHOST" =~ $RE ]]; do
CFG_ISPONCFIG_PORT=8888 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)
fi done
fi
echo -n -e "$IDENTATION_LVL_2 ${BBlack}ISPConfig Port${NC}: ${green}" $CFG_ISPONCFIG_PORT "${NC} " echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install cloud server ${NC}: ${green}$CFG_CLOUDINSTALL${NC} "
echo echo
CFG_ISPONCFIG_APPS_PORT=$(whiptail --title "ISPConfig" --backtitle "$WT_BACKTITLE" --inputbox \ echo -n -e "$IDENTATION_LVL_1 ${BBlack}ISPConfig Configuration: ${NC}"
"Please specify a ISPConfig Apps Port (leave empty for use 8083 port)" --nocancel 10 60 3>&1 1>&2 2>&3) echo
if [[ -z $CFG_ISPONCFIG_APPS_PORT ]]; then while [[ ! "$CFG_ISPC" =~ $RE ]]; do
CFG_ISPONCFIG_APPS_PORT=8083 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)
fi done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Install Mode${NC}: ${green}" $CFG_ISPC "${NC} "
echo
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)
if [[ -z $CFG_ISPONCFIG_PORT ]]; then
CFG_ISPONCFIG_PORT=8888
fi
echo -n -e "$IDENTATION_LVL_2 ${BBlack}ISPConfig Port${NC}: ${green}" $CFG_ISPONCFIG_PORT "${NC} "
echo
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)
if [[ -z $CFG_ISPONCFIG_APPS_PORT ]]; then
CFG_ISPONCFIG_APPS_PORT=8083
fi
echo -n -e "$IDENTATION_LVL_2 ${BBlack}ISPConfig Apps Port${NC}: ${green}" $CFG_ISPONCFIG_APPS_PORT "${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}ISPConfig Apps Port${NC}: ${green}" $CFG_ISPONCFIG_APPS_PORT "${NC} "
echo echo
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve ISPConfig Admin password${NC}: " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve ISPConfig Admin password${NC}: "
CFG_ISPONCFIG_ADMIN_PASS=$(whiptail --title "ISPConfig" --backtitle "$WT_BACKTITLE" --inputbox \ CFG_ISPONCFIG_ADMIN_PASS=$(whiptail --title "ISPConfig" --backtitle "$WT_BACKTITLE" --inputbox "Please specify an ISPConfig Admin Password (leave empty for autogenerate)" --nocancel $WT_HEIGHT $WT_WIDTH 3>&1 1>&2 2>&3)
"Please specify a ISPConfig Admin Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3)
if [[ -z $CFG_ISPONCFIG_ADMIN_PASS ]]; then if [[ -z $CFG_ISPONCFIG_ADMIN_PASS ]]; then
CFG_ISPONCFIG_ADMIN_PASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29}) CFG_ISPONCFIG_ADMIN_PASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9' | head -c${1:-29})
fi fi
echo -e " [ ${green}DONE${NC} ] " echo -e " [${green}DONE${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 "Please specify an ISPConfig DB Password (leave empty for autogenerate)" --nocancel $WT_HEIGHT $WT_WIDTH 3>&1 1>&2 2>&3)
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve ISPConfig DB password${NC}: " if [[ -z $CFG_ISPONCFIG_ADMIN_PASS ]]; then
CFG_ISPCONFIG_DB_PASS=$(whiptail --title "ISPConfig DB Password" --backtitle "$WT_BACKTITLE" --inputbox \ CFG_ISPCONFIG_DB_PASS_AUTO=true
"Please specify a ISPConfig DB Password (leave empty for autogenerate)" --nocancel 10 60 3>&1 1>&2 2>&3) CFG_ISPCONFIG_DB_PASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9~!@#^*_=-' | head -c${1:-29})
else
CFG_ISPCONFIG_DB_PASS_AUTO=false
fi
if [[ -z $CFG_ISPONCFIG_ADMIN_PASS ]]; then echo -e " [${green}DONE${NC}]"
CFG_ISPCONFIG_DB_PASS_AUTO=true
CFG_ISPCONFIG_DB_PASS=$(tr </dev/urandom -dc 'A-Z-a-z-0-9~!@#^*_=-' | head -c${1:-29})
else
CFG_ISPCONFIG_DB_PASS_AUTO=false
fi
echo -e " [ ${green}DONE${NC} ] " echo -n -e "$IDENTATION_LVL_1 ${BBlack}SSL Configuration:${NC} "
echo
echo -n -e "$IDENTATION_LVL_1 ${BBlack}SSL Configuration:${NC} " while [[ ! "$SSL_COUNTRY" =~ $RE ]]; do
echo SSL_COUNTRY=$(whiptail --title "SSL Country Code" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Country Code (2 letter code - ex. HU)" --nocancel $WT_HEIGHT $WT_WIDTH "HU" 3>&1 1>&2 2>&3)
done
while [[ ! "$SSL_COUNTRY" =~ $RE ]] echo -n -e "$IDENTATION_LVL_2 ${BBlack}Country${NC}: ${green}" $SSL_COUNTRY "${NC} "
do echo
SSL_COUNTRY=$(whiptail --title "SSL Country Code" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Country Code (2 letter code - ex. HU)" --nocancel 10 60 "HU" 3>&1 1>&2 2>&3)
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Country${NC}: ${green}" $SSL_COUNTRY "${NC} "
echo
while [[ ! "$SSL_STATE" =~ $RE ]] while [[ ! "$SSL_STATE" =~ $RE ]]; do
do 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)
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) done
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}State${NC}: ${green}" $SSL_STATE "${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}State${NC}: ${green}" $SSL_STATE "${NC} "
echo echo
while [[ ! "$SSL_LOCALITY" =~ $RE ]] while [[ ! "$SSL_LOCALITY" =~ $RE ]]; do
do SSL_LOCALITY=$(whiptail --title "SSL Locality" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Locality (ex. Bekescsaba)" --nocancel $WT_HEIGHT $WT_WIDTH "Bekescsaba" 3>&1 1>&2 2>&3)
SSL_LOCALITY=$(whiptail --title "SSL Locality" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Locality (ex. Bekescsaba)" --nocancel 10 60 "Bekescsaba" 3>&1 1>&2 2>&3) done
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Locality${NC}: ${green}" $SSL_LOCALITY "${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Locality${NC}: ${green}" $SSL_LOCALITY "${NC} "
echo echo
while [[ ! "$SSL_ORGANIZATION" =~ $RE ]] while [[ ! "$SSL_ORGANIZATION" =~ $RE ]]; do
do SSL_ORGANIZATION=$(whiptail --title "SSL Organization" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization (ex. Company L.t.d.)" --nocancel $WT_HEIGHT $WT_WIDTH "Wolftronics L.t.d" 3>&1 1>&2 2>&3)
SSL_ORGANIZATION=$(whiptail --title "SSL Organization" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization (ex. Company L.t.d.)" --nocancel 10 60 "Wolftronics L.t.d" 3>&1 1>&2 2>&3) done
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Organization${NC}: ${green}" $SSL_ORGANIZATION "${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Organization${NC}: ${green}" $SSL_ORGANIZATION "${NC} "
echo echo
while [[ ! "$SSL_ORGUNIT" =~ $RE ]] while [[ ! "$SSL_ORGUNIT" =~ $RE ]]; do
do SSL_ORGUNIT=$(whiptail --title "SSL Organization Unit" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization Unit (ex. IT)" --nocancel $WT_HEIGHT $WT_WIDTH "IT" 3>&1 1>&2 2>&3)
SSL_ORGUNIT=$(whiptail --title "SSL Organization Unit" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization Unit (ex. IT)" --nocancel 10 60 "IT" 3>&1 1>&2 2>&3) done
done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Unit${NC}: ${green}" $SSL_ORGUNIT "${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Unit${NC}: ${green}" $SSL_ORGUNIT "${NC} "
echo echo
MeasureTimeDuration $START_TIME MeasureTimeDuration $START_TIME
} }
...@@ -9,7 +9,7 @@ InstallAditionalRepos() { ...@@ -9,7 +9,7 @@ InstallAditionalRepos() {
echo -n -e "$IDENTATION_LVL_0 ${BWhite} Start Adding additional repositories ${NC} \n" echo -n -e "$IDENTATION_LVL_0 ${BWhite} Start Adding additional repositories ${NC} \n"
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Update Packages Before we start ${NC} ... " echo -n -e "$IDENTATION_LVL_1 ${BBlack}Update Packages Before we start ${NC} ... "
package_update apt_update
echo -e " [ ${green}DONE${NC} ]" echo -e " [ ${green}DONE${NC} ]"
#Check for apt-transport-https #Check for apt-transport-https
...@@ -17,7 +17,7 @@ InstallAditionalRepos() { ...@@ -17,7 +17,7 @@ InstallAditionalRepos() {
echo -n -e "$IDENTATION_LVL_1 ${BBlack}APT HTTPS Method${NC}: ${green}Already Installed${NC}\n" echo -n -e "$IDENTATION_LVL_1 ${BBlack}APT HTTPS Method${NC}: ${green}Already Installed${NC}\n"
else else
echo -n -e "$IDENTATION_LVL_1 ${BBlack}APT HTTPS Method${NC}: ${red}NOT FOUND${NC} - try to install it ... " echo -n -e "$IDENTATION_LVL_1 ${BBlack}APT HTTPS Method${NC}: ${red}NOT FOUND${NC} - try to install it ... "
package_install apt-transport-https apt_install apt-transport-https
echo -e " [ ${green}DONE${NC} ]" echo -e " [ ${green}DONE${NC} ]"
fi fi
...@@ -94,7 +94,7 @@ Pin-Priority: 400 ...@@ -94,7 +94,7 @@ Pin-Priority: 400
echo -e " [ ${green}DONE${NC} ]" echo -e " [ ${green}DONE${NC} ]"
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Update Packages Before at the final${NC} ... " echo -n -e "$IDENTATION_LVL_1 ${BBlack}Update Packages Before at the final${NC} ... "
package_update apt_update
echo -e " [ ${green}DONE${NC} ]" echo -e " [ ${green}DONE${NC} ]"
MeasureTimeDuration $START_TIME MeasureTimeDuration $START_TIME
......
...@@ -9,7 +9,7 @@ InstallAntiVirus() { ...@@ -9,7 +9,7 @@ InstallAntiVirus() {
if [ "$CFG_ANTISPAM" == "amavisd" ]; then if [ "$CFG_ANTISPAM" == "amavisd" ]; then
echo -n -e "$IDENTATION_LVL_1 Installing Antispam utilities (Amavisd-new), Spam filtering (SpamAssassin) and Greylisting (Postgrey) (This take some time. Don't abort it!)...." echo -n -e "$IDENTATION_LVL_1 Installing Antispam utilities (Amavisd-new), Spam filtering (SpamAssassin) and Greylisting (Postgrey) (This take some time. Don't abort it!)...."
package_install amavisd-new spamassassin postgrey apt_install amavisd-new spamassassin postgrey
echo "use strict;" > /etc/amavis/conf.d/05-node_id echo "use strict;" > /etc/amavis/conf.d/05-node_id
echo "chomp(\$myhostname = \`hostname --fqdn\`);" >> /etc/amavis/conf.d/05-node_id echo "chomp(\$myhostname = \`hostname --fqdn\`);" >> /etc/amavis/conf.d/05-node_id
echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id
...@@ -24,16 +24,16 @@ InstallAntiVirus() { ...@@ -24,16 +24,16 @@ InstallAntiVirus() {
echo -e " [ ${green}DONE${NC} ] " echo -e " [ ${green}DONE${NC} ] "
elif [ "$CFG_ANTISPAM" == "rspamd" ]; then elif [ "$CFG_ANTISPAM" == "rspamd" ]; then
echo -n -e "$IDENTATION_LVL_1 Installing Antispam utilities (Rspamd) (This take some time. Don't abort it!)..." echo -n -e "$IDENTATION_LVL_1 Installing Antispam utilities (Rspamd) (This take some time. Don't abort it!)..."
package_install redis-server lsb-release apt_install redis-server lsb-release
if [[ "$(which named)" == "" ]]; then if [[ "$(which named)" == "" ]]; then
package_install unbound apt_install unbound
fi fi
CODENAME=`lsb_release -c -s` CODENAME=`lsb_release -c -s`
curl https://rspamd.com/apt-stable/gpg.key | apt-key add - curl https://rspamd.com/apt-stable/gpg.key | apt-key add -
echo "deb [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" > /etc/apt/sources.list.d/rspamd.list echo "deb [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" > /etc/apt/sources.list.d/rspamd.list
echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" >> /etc/apt/sources.list.d/rspamd.list echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" >> /etc/apt/sources.list.d/rspamd.list
package_update apt_update
package_install rspamd apt_install rspamd
echo 'servers = "127.0.0.1";' > /etc/rspamd/local.d/redis.conf echo 'servers = "127.0.0.1";' > /etc/rspamd/local.d/redis.conf
echo "nrows = 2500;" > /etc/rspamd/local.d/history_redis.conf echo "nrows = 2500;" > /etc/rspamd/local.d/history_redis.conf
echo "compress = true;" >> /etc/rspamd/local.d/history_redis.conf echo "compress = true;" >> /etc/rspamd/local.d/history_redis.conf
...@@ -46,7 +46,7 @@ InstallAntiVirus() { ...@@ -46,7 +46,7 @@ InstallAntiVirus() {
fi fi
echo -n -e "$IDENTATION_LVL_1 Installing AntiVirus utilities (ClamAV) (This take some time. Don't abort it!)..." echo -n -e "$IDENTATION_LVL_1 Installing AntiVirus utilities (ClamAV) (This take some time. Don't abort it!)..."
package_install clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libclamunrar9 libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl unrar-free unp lz4 liblz4-tool rpm2cpio tnef unp apt_install clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libclamunrar9 libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl unrar-free unp lz4 liblz4-tool rpm2cpio tnef unp
echo -e " [ ${green}DONE${NC} ] " echo -e " [ ${green}DONE${NC} ] "
echo -n -e "$IDENTATION_LVL_1 Configure AntiVirus ... " echo -n -e "$IDENTATION_LVL_1 Configure AntiVirus ... "
......
...@@ -7,7 +7,7 @@ InstallBasePhp() { ...@@ -7,7 +7,7 @@ InstallBasePhp() {
echo -e "$IDENTATION_LVL_0 ${BWhite}Installing basic PHP modules for ISPConfig${NC}" echo -e "$IDENTATION_LVL_0 ${BWhite}Installing basic PHP modules for ISPConfig${NC}"
echo -n -e "$IDENTATION_LVL_1 Installing required components (PHP 8.2)... " echo -n -e "$IDENTATION_LVL_1 Installing required components (PHP 8.2)... "
package_install php8.2-fpm php8.2-cli php8.2-mysql php8.2-mcrypt php8.2-mbstring apt_install php8.2-fpm php8.2-cli php8.2-mysql php8.2-mcrypt php8.2-mbstring
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
MeasureTimeDuration $START_TIME MeasureTimeDuration $START_TIME
......
...@@ -9,7 +9,7 @@ InstallBind() { ...@@ -9,7 +9,7 @@ InstallBind() {
echo -n -e "$IDENTATION_LVL_1 Installing Bind9 and Haveged... " echo -n -e "$IDENTATION_LVL_1 Installing Bind9 and Haveged... "
# If your server is a virtual machine, it is highly recommended to install the haveged daemon # If your server is a virtual machine, it is highly recommended to install the haveged daemon
# to increase entropy for DNSSEC signing. It is also safe to install haveged on non-virtual servers. # to increase entropy for DNSSEC signing. It is also safe to install haveged on non-virtual servers.
if ! package_install bind9 dnsutils haveged; then if ! apt_install bind9 dnsutils haveged; then
echo -e "[${red}FAILED${NC}]" echo -e "[${red}FAILED${NC}]"
echo -e "$IDENTATION_LVL_2 ${red}Failed to install packages. Check the log file for more details.${NC}" echo -e "$IDENTATION_LVL_2 ${red}Failed to install packages. Check the log file for more details.${NC}"
exit 1 exit 1
......
...@@ -7,7 +7,7 @@ InstallFail2ban() { ...@@ -7,7 +7,7 @@ InstallFail2ban() {
echo -e "$IDENTATION_LVL_0 ${BWhite}Installing Fail2Ban and Rootkit detection (rkhunter)${NC}" echo -e "$IDENTATION_LVL_0 ${BWhite}Installing Fail2Ban and Rootkit detection (rkhunter)${NC}"
echo -n -e "$IDENTATION_LVL_1 Installing required components... " echo -n -e "$IDENTATION_LVL_1 Installing required components... "
package_install fail2ban rkhunter apt_install fail2ban rkhunter
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
# Configure Fail2Ban based on the selected MTA # Configure Fail2Ban based on the selected MTA
...@@ -172,7 +172,7 @@ EOF ...@@ -172,7 +172,7 @@ EOF
# Install and configure UFW firewall # Install and configure UFW firewall
echo -n -e "$IDENTATION_LVL_1 Installing Firewall (UFW)... " echo -n -e "$IDENTATION_LVL_1 Installing Firewall (UFW)... "
package_install ufw apt_install ufw
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
# Measure and display the time taken for the installation # Measure and display the time taken for the installation
......
...@@ -17,7 +17,7 @@ InstallFTP() { ...@@ -17,7 +17,7 @@ InstallFTP() {
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -e "$IDENTATION_LVL_1 Installing PureFTPd... " echo -e "$IDENTATION_LVL_1 Installing PureFTPd... "
package_install pure-ftpd-common pure-ftpd-mysql apt_install pure-ftpd-common pure-ftpd-mysql
sed -i 's/ftp/\#ftp/' /etc/inetd.conf >>"$PROGRAMS_INSTALL_LOG_FILES" 2>&1 sed -i 's/ftp/\#ftp/' /etc/inetd.conf >>"$PROGRAMS_INSTALL_LOG_FILES" 2>&1
echo -e " [${green}DONE${NC}]" echo -e " [${green}DONE${NC}]"
......
...@@ -55,7 +55,7 @@ InstallGitlabCE() { ...@@ -55,7 +55,7 @@ InstallGitlabCE() {
#sudo sed -i 's/http:\/\/lt\./http:\/\//g' /etc/apt/sources.list.d/passenger.list #sudo sed -i 's/http:\/\/lt\./http:\/\//g' /etc/apt/sources.list.d/passenger.list
#hide_output apt-get update #hide_output apt-get update
#deleted etc/nginx!!!!! backup!!!!! #deleted etc/nginx!!!!! backup!!!!!
#apt-get purge nginx nginx-full nginx-light nginx-naxsi nginx-common #apt_purge_remove nginx nginx-full nginx-light nginx-naxsi nginx-common
#apt_install nginx-extras passenger #apt_install nginx-extras passenger
#sed -i "s|^\(http {\).*$|\1\\ninclude \/etc\/nginx\/passenger.conf;|" /etc/nginx/nginx.conf #sed -i "s|^\(http {\).*$|\1\\ninclude \/etc\/nginx\/passenger.conf;|" /etc/nginx/nginx.conf
......
...@@ -6,7 +6,7 @@ InstallJailkit() { ...@@ -6,7 +6,7 @@ InstallJailkit() {
local START_TIME=$SECONDS local START_TIME=$SECONDS
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing JailKit... " echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing JailKit... "
package_install jailkit apt_install jailkit
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
MeasureTimeDuration $START_TIME MeasureTimeDuration $START_TIME
......
...@@ -10,12 +10,12 @@ InstallLetsEncrypt() { ...@@ -10,12 +10,12 @@ InstallLetsEncrypt() {
if [ $CFG_CERTBOT_VERSION == "certbot" ]; then if [ $CFG_CERTBOT_VERSION == "certbot" ]; then
if [ $CFG_WEBSERVER == "apache" ]; then if [ $CFG_WEBSERVER == "apache" ]; then
echo -n -e "$IDENTATION_LVL_1 Installing certbot for Apache... " echo -n -e "$IDENTATION_LVL_1 Installing certbot for Apache... "
package_install certbot python3-certbot-apache apt_install certbot python3-certbot-apache
certbot --apache >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 certbot --apache >>$PROGRAMS_INSTALL_LOG_FILES 2>&1
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
elif [ $CFG_WEBSERVER == "nginx" ]; then elif [ $CFG_WEBSERVER == "nginx" ]; then
echo -n -e "$IDENTATION_LVL_1 Installing certbot for Nginx... " echo -n -e "$IDENTATION_LVL_1 Installing certbot for Nginx... "
package_install certbot python3-certbot-nginx apt_install certbot python3-certbot-nginx
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
fi fi
......
...@@ -9,7 +9,7 @@ InstallMetronome() { ...@@ -9,7 +9,7 @@ InstallMetronome() {
# Install required packages # Install required packages
echo -e "$IDENTATION_LVL_1 ${BWhite}Installing dependencies...${NC}" echo -e "$IDENTATION_LVL_1 ${BWhite}Installing dependencies...${NC}"
package_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks apt_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "$IDENTATION_LVL_1 ${red}Failed to install dependencies. Aborting.${NC}" echo -e "$IDENTATION_LVL_1 ${red}Failed to install dependencies. Aborting.${NC}"
return 1 return 1
......
...@@ -16,7 +16,7 @@ InstallMTA() { ...@@ -16,7 +16,7 @@ InstallMTA() {
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_2 Installing Courier and dependecies... " echo -n -e "$IDENTATION_LVL_2 Installing Courier and dependecies... "
package_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_2 Config saslauthd... " echo -n -e "$IDENTATION_LVL_2 Config saslauthd... "
...@@ -47,7 +47,7 @@ InstallMTA() { ...@@ -47,7 +47,7 @@ InstallMTA() {
"dovecot") "dovecot")
echo -n -e "$IDENTATION_LVL_1 Installing POP3/IMAP Mail server ${red}Dovecot ${NC} and Mail signing (OpenDKIM)..." echo -n -e "$IDENTATION_LVL_1 Installing POP3/IMAP Mail server ${red}Dovecot ${NC} and Mail signing (OpenDKIM)..."
echo -n -e "$IDENTATION_LVL_2 Installing Dovecot and dependecies... " echo -n -e "$IDENTATION_LVL_2 Installing Dovecot and dependecies... "
package_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd dovecot-managesieved dovecot-antispam opendkim opendkim-tools apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd dovecot-managesieved dovecot-antispam opendkim opendkim-tools
# The `default_process_limit` is 100, which constrains the total number # The `default_process_limit` is 100, which constrains the total number
# of active IMAP connections (at, say, 5 open connections per user that # of active IMAP connections (at, say, 5 open connections per user that
......
...@@ -37,7 +37,7 @@ InstallSQLServer() { ...@@ -37,7 +37,7 @@ InstallSQLServer() {
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Updating package list... " echo -n -e "$IDENTATION_LVL_1 Updating package list... "
package_update apt_update
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo "mysql-community-server mysql-community-server/root-pass password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections echo "mysql-community-server mysql-community-server/root-pass password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections
...@@ -63,7 +63,7 @@ InstallSQLServer() { ...@@ -63,7 +63,7 @@ InstallSQLServer() {
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Updating package list... " echo -n -e "$IDENTATION_LVL_1 Updating package list... "
package_update apt_update
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 SSetting MySQL root password... " echo -n -e "$IDENTATION_LVL_1 SSetting MySQL root password... "
...@@ -79,7 +79,7 @@ InstallSQLServer() { ...@@ -79,7 +79,7 @@ InstallSQLServer() {
if [ $SHOULD_INSTALL_MYSQL == true ]; then if [ $SHOULD_INSTALL_MYSQL == true ]; then
echo -n -e "$IDENTATION_LVL_1 Installing MySQL Server & Client... " echo -n -e "$IDENTATION_LVL_1 Installing MySQL Server & Client... "
package_install mysql-client mysql-server apt_install mysql-client mysql-server
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Configuring MySQL... " echo -n -e "$IDENTATION_LVL_1 Configuring MySQL... "
...@@ -154,14 +154,14 @@ default-authentication-plugin=mysql_native_password ...@@ -154,14 +154,14 @@ default-authentication-plugin=mysql_native_password
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Installing MariaDB Server & Client... " echo -n -e "$IDENTATION_LVL_1 Installing MariaDB Server & Client... "
package_install software-properties-common dirmngr apt-transport-https apt_install software-properties-common dirmngr apt-transport-https
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
add-apt-repository 'deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian bookworm main' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 yes | add-apt-repository 'deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian bookworm main' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
package_update apt_update
package_install mariadb-client mariadb-server apt_install mariadb-client mariadb-server
#Galera cluster #Galera cluster
#package_install mariadb-backup galera-4 #apt_install mariadb-backup galera-4
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Configuring MariaDB... " echo -n -e "$IDENTATION_LVL_1 Configuring MariaDB... "
...@@ -182,7 +182,7 @@ default-authentication-plugin=mysql_native_password ...@@ -182,7 +182,7 @@ default-authentication-plugin=mysql_native_password
#EOF #EOF
echo -n -e "$IDENTATION_LVL_1 Securing MariaDB installation... " echo -n -e "$IDENTATION_LVL_1 Securing MariaDB installation... "
package_install expect apt_install expect
SECURE_MYSQL=$(expect -c " SECURE_MYSQL=$(expect -c "
set timeout 10 set timeout 10
spawn mysql_secure_installation spawn mysql_secure_installation
...@@ -201,7 +201,7 @@ default-authentication-plugin=mysql_native_password ...@@ -201,7 +201,7 @@ default-authentication-plugin=mysql_native_password
expect eof expect eof
") ")
echo "$SECURE_MYSQL" > /dev/null 2>&1 echo "$SECURE_MYSQL" > /dev/null 2>&1
package_purge_remove expect apt_purge_remove expect
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Increasing file limits for MariaDB... " echo -n -e "$IDENTATION_LVL_1 Increasing file limits for MariaDB... "
...@@ -236,7 +236,7 @@ default-authentication-plugin=mysql_native_password ...@@ -236,7 +236,7 @@ default-authentication-plugin=mysql_native_password
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
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:
sed -i -r 's/_dbc_nodb="yes" dbc_mysql_exec/_dbc_nodb="yes"; dbc_mysql_exec/g' /usr/share/dbconfig-common/internal/mysql sed -i -r 's/_dbc_nodb="yes" dbc_mysql_exec/_dbc_nodb="yes"; dbc_mysql_exec/g' /usr/share/dbconfig-common/internal/mysql
systemctl daemon-reload >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 systemctl daemon-reload >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
......
...@@ -58,7 +58,7 @@ InstallNextcloud() { ...@@ -58,7 +58,7 @@ InstallNextcloud() {
echo -n -e "$IDENTATION_LVL_1 Installing required packages... " echo -n -e "$IDENTATION_LVL_1 Installing required packages... "
# Install required PHP packages # Install required PHP packages
package_install php8.2 php8.2-fpm php8.2-cli php8.2-sqlite php8.2-gd php8.2-imap php8.2-curl php-pear curl \ apt_install php8.2 php8.2-fpm php8.2-cli php8.2-sqlite php8.2-gd php8.2-imap php8.2-curl php-pear curl \
php8.2-dev memcached php-memcached php8.2-xml php8.2-mbstring php8.2-zip php8.2-apcu \ php8.2-dev memcached php-memcached php8.2-xml php8.2-mbstring php8.2-zip php8.2-apcu \
php8.2-fpm php8.2-mysql php8.2-xsl php8.2-gmp php8.2-bcmath php8.2-cgi php-gettext libxml2-dev \ php8.2-fpm php8.2-mysql php8.2-xsl php8.2-gmp php8.2-bcmath php8.2-cgi php-gettext libxml2-dev \
php8.2-json php8.2-intl php8.2-imagick php8.2-common php8.2-opcache php8.2-readline php8.2 php8.2-json php8.2-intl php8.2-imagick php8.2-common php8.2-opcache php8.2-readline php8.2
......
...@@ -11,7 +11,7 @@ InstallPostfix() { ...@@ -11,7 +11,7 @@ InstallPostfix() {
if [ -f /etc/init.d/sendmail ]; then if [ -f /etc/init.d/sendmail ]; then
service sendmail stop >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 service sendmail stop >>$PROGRAMS_INSTALL_LOG_FILES 2>&1
update-rc.d -f sendmail remove >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 update-rc.d -f sendmail remove >>$PROGRAMS_INSTALL_LOG_FILES 2>&1
package_remove sendmail apt_remove sendmail
fi fi
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
...@@ -21,7 +21,7 @@ InstallPostfix() { ...@@ -21,7 +21,7 @@ InstallPostfix() {
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Install SMTP Mail server (Postfix)... " echo -n -e "$IDENTATION_LVL_1 Install SMTP Mail server (Postfix)... "
package_install postfix postfix-mysql postfix-doc postfix-pcre ca-certificates apt_install postfix postfix-mysql postfix-doc postfix-pcre ca-certificates
echo -e "[${green}DONE${NC}] " echo -e "[${green}DONE${NC}] "
echo -n -e "$IDENTATION_LVL_1 Configure SMTP Mail server (Postfix)... " echo -n -e "$IDENTATION_LVL_1 Configure SMTP Mail server (Postfix)... "
......
...@@ -8,7 +8,7 @@ InstallQuota() { ...@@ -8,7 +8,7 @@ InstallQuota() {
echo -e "$IDENTATION_LVL_0 ${BWhite}Installing Disk Quota${NC}" echo -e "$IDENTATION_LVL_0 ${BWhite}Installing Disk Quota${NC}"
# Install necessary packages # Install necessary packages
if ! package_install quota quotatool >>$PROGRAMS_INSTALL_LOG_FILES 2>&1; then if ! apt_install quota quotatool >>$PROGRAMS_INSTALL_LOG_FILES 2>&1; then
echo -e "$IDENTATION_LVL_1 ${red}Failed to install Quota packages. Check the log file for details.${NC}" echo -e "$IDENTATION_LVL_1 ${red}Failed to install Quota packages. Check the log file for details.${NC}"
return 1 return 1
fi fi
......
...@@ -36,15 +36,15 @@ InstallWeblate() { ...@@ -36,15 +36,15 @@ InstallWeblate() {
echo -e "[${green}DONE${NC}]\n" echo -e "[${green}DONE${NC}]\n"
echo -n -e "$IDENTATION_LVL_1 Installing packages..." echo -n -e "$IDENTATION_LVL_1 Installing packages..."
package_install libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev libcairo-dev gir1.2-pango-1.0 libgirepository1.0-dev libacl1-dev libssl-dev build-essential python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev libcairo-dev gir1.2-pango-1.0 libgirepository1.0-dev libacl1-dev libssl-dev build-essential python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# pycairo setup is a bit flaky, workarounds: # pycairo setup is a bit flaky, workarounds:
# https://github.com/pygobject/pycairo/issues/60: sudo apt install pkg-config # https://github.com/pygobject/pycairo/issues/60: sudo apt install pkg-config
# https://github.com/pygobject/pycairo/issues/39: sudo apt install python-dev libcairo2-dev libjpeg-dev libgif-dev # https://github.com/pygobject/pycairo/issues/39: sudo apt install python-dev libcairo2-dev libjpeg-dev libgif-dev
package_install pkg-config python-dev libcairo2-dev libjpeg-dev libgif-dev >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install pkg-config python-dev libcairo2-dev libjpeg-dev libgif-dev
package_install sudo uwsgi uwsgi-plugin-python3 nginx openssh-client ca-certificates curl \ apt_install sudo uwsgi uwsgi-plugin-python3 nginx openssh-client ca-certificates curl \
gir1.2-pango-1.0 \ gir1.2-pango-1.0 \
libxmlsec1-openssl \ libxmlsec1-openssl \
libjpeg62-turbo \ libjpeg62-turbo \
...@@ -156,7 +156,7 @@ InstallWeblate() { ...@@ -156,7 +156,7 @@ InstallWeblate() {
echo -e "[${green}DONE${NC}]\n" echo -e "[${green}DONE${NC}]\n"
echo -n -e "$IDENTATION_LVL_1 Installing redis server..." echo -n -e "$IDENTATION_LVL_1 Installing redis server..."
package_install redis-server >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install redis-server
# They do not enable continuous liveness pings back to your supervisor. # They do not enable continuous liveness pings back to your supervisor.
sed -i "s/supervised no/supervised systemd/" /etc/redis/redis.conf sed -i "s/supervised no/supervised systemd/" /etc/redis/redis.conf
...@@ -200,7 +200,7 @@ InstallWeblate() { ...@@ -200,7 +200,7 @@ InstallWeblate() {
service redis restart >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 service redis restart >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
package_install postgresql postgresql-contrib >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install postgresql postgresql-contrib
# If PostgreSQL was not installed before, set the master password # If PostgreSQL was not installed before, set the master password
#sudo -u postgres psql postgres -c "\password postgres" #sudo -u postgres psql postgres -c "\password postgres"
......
...@@ -36,16 +36,16 @@ InstallWeblate() { ...@@ -36,16 +36,16 @@ InstallWeblate() {
echo -e "[${green}DONE${NC}]\n" echo -e "[${green}DONE${NC}]\n"
echo -n -e "$IDENTATION_LVL_1 Installing packages..." echo -n -e "$IDENTATION_LVL_1 Installing packages..."
package_install libxml2-dev libxslt1-dev libfreetype6-dev libjpeg-dev zlib1g-dev libyaml-dev libcairo2-dev gir1.2-pango-1.0 libgirepository1.0-dev libacl1-dev libssl-dev build-essential python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install libxml2-dev libxslt1-dev libfreetype6-dev libjpeg-dev zlib1g-dev libyaml-dev libcairo2-dev gir1.2-pango-1.0 libgirepository1.0-dev libacl1-dev libssl-dev build-essential python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# pycairo setup is a bit flaky, workarounds: # pycairo setup is a bit flaky, workarounds:
# https://github.com/pygobject/pycairo/issues/60: sudo apt install pkg-config # https://github.com/pygobject/pycairo/issues/60: sudo apt install pkg-config
# https://github.com/pygobject/pycairo/issues/39: sudo apt install python-dev libcairo2-dev libjpeg-dev libgif-dev # https://github.com/pygobject/pycairo/issues/39: sudo apt install python-dev libcairo2-dev libjpeg-dev libgif-dev
#package_install pkg-config python-dev libcairo2-dev libjpeg-dev libgif-dev >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 #apt_install pkg-config python-dev libcairo2-dev libjpeg-dev libgif-dev >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
package_install pkg-config libgif-dev >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install pkg-config libgif-dev >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
package_install sudo uwsgi uwsgi-plugin-python3 nginx openssh-client ca-certificates curl \ apt_install sudo uwsgi uwsgi-plugin-python3 nginx openssh-client ca-certificates curl \
gir1.2-pango-1.0 \ gir1.2-pango-1.0 \
libxmlsec1-openssl \ libxmlsec1-openssl \
libjpeg62-turbo \ libjpeg62-turbo \
...@@ -155,7 +155,7 @@ InstallWeblate() { ...@@ -155,7 +155,7 @@ InstallWeblate() {
echo -e "[${green}DONE${NC}]\n" echo -e "[${green}DONE${NC}]\n"
echo -n -e "$IDENTATION_LVL_1 Installing redis server..." echo -n -e "$IDENTATION_LVL_1 Installing redis server..."
package_install redis-server >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install redis-server >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# They do not enable continuous liveness pings back to your supervisor. # They do not enable continuous liveness pings back to your supervisor.
sed -i "s/supervised no/supervised systemd/" /etc/redis/redis.conf sed -i "s/supervised no/supervised systemd/" /etc/redis/redis.conf
...@@ -199,7 +199,7 @@ InstallWeblate() { ...@@ -199,7 +199,7 @@ InstallWeblate() {
service redis restart >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 service redis restart >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
package_install postgresql postgresql-contrib >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 apt_install postgresql postgresql-contrib >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# If PostgreSQL was not installed before, set the master password # If PostgreSQL was not installed before, set the master password
#sudo -u postgres psql postgres -c "\password postgres" #sudo -u postgres psql postgres -c "\password postgres"
......
...@@ -101,7 +101,7 @@ InstallRoundcubeStable() { ...@@ -101,7 +101,7 @@ InstallRoundcubeStable() {
# Install Roundcube packages # Install Roundcube packages
echo -e "$IDENTATION_LVL_2 Installing Roundcube packages... " echo -e "$IDENTATION_LVL_2 Installing Roundcube packages... "
package_install roundcube-core roundcube roundcube-mysql roundcube-plugins apt_install roundcube-core roundcube roundcube-mysql roundcube-plugins
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
# Configure Roundcube on WebServer # Configure Roundcube on WebServer
...@@ -131,7 +131,7 @@ InstallRoundcubeLatest() { ...@@ -131,7 +131,7 @@ InstallRoundcubeLatest() {
# Install required PHP packages # Install required PHP packages
echo -e "$IDENTATION_LVL_2 Installing required PHP packages... " echo -e "$IDENTATION_LVL_2 Installing required PHP packages... "
package_install -t php8.2 php8.2-gd php8.2-mysql php8.2-curl php8.2-zip php8.2-ldap php8.2-mbstring php8.2-imagick php8.2-intl php8.2-xml php8.2-dom php8.2-xmlreader php8.2-xmlwriter php8.2-gettext php8.2-json php8.2-gd php8.2-bcmath php8.2-cgi php8.2-gmp php8.2-common php8.2-fpm php-pear unzip wget curl javascript-common libjs-jquery-mousewheel libjs-jquery libmagic1 tinymce apt_install -t php8.2 php8.2-gd php8.2-mysql php8.2-curl php8.2-zip php8.2-ldap php8.2-mbstring php8.2-imagick php8.2-intl php8.2-xml php8.2-dom php8.2-xmlreader php8.2-xmlwriter php8.2-gettext php8.2-json php8.2-gd php8.2-bcmath php8.2-cgi php8.2-gmp php8.2-common php8.2-fpm php-pear unzip wget curl javascript-common libjs-jquery-mousewheel libjs-jquery libmagic1 tinymce
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -e "$IDENTATION_LVL_2 Installing required PHP pear packages... " echo -e "$IDENTATION_LVL_2 Installing required PHP pear packages... "
...@@ -142,7 +142,7 @@ InstallRoundcubeLatest() { ...@@ -142,7 +142,7 @@ InstallRoundcubeLatest() {
pear install Net_IDNA2 pear install Net_IDNA2
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
apt-get purge -qq -y roundcube* apt_purge_remove roundcube*
needs_update=0 needs_update=0
if [ ! -f /usr/local/lib/roundcubemail/version ]; then if [ ! -f /usr/local/lib/roundcubemail/version ]; then
......
...@@ -101,7 +101,7 @@ InstallWebServer() { ...@@ -101,7 +101,7 @@ InstallWebServer() {
curl -sSL https://packages.sury.org/nginx-mainline/README.txt | sudo bash -x >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 curl -sSL https://packages.sury.org/nginx-mainline/README.txt | sudo bash -x >>$PROGRAMS_INSTALL_LOG_FILES 2>&1
package_update apt_update
#apt_install nginx-core nginx nginx-common nginx-module-geoip nginx-module-image-filter nginx-module-njs nginx-module-perl nginx-module-xslt #apt_install nginx-core nginx nginx-common nginx-module-geoip nginx-module-image-filter nginx-module-njs nginx-module-perl nginx-module-xslt
apt_install nginx-full nginx-module-geoip nginx-module-image-filter apt_install nginx-full nginx-module-geoip nginx-module-image-filter
......
...@@ -7,7 +7,7 @@ InstallWebStats() { ...@@ -7,7 +7,7 @@ InstallWebStats() {
echo -e "$IDENTATION_LVL_0 ${BWhite}Installing Web Statistics Tools${NC}" echo -e "$IDENTATION_LVL_0 ${BWhite}Installing Web Statistics Tools${NC}"
echo -n -e "$IDENTATION_LVL_1 Installing Required Components... " echo -n -e "$IDENTATION_LVL_1 Installing Required Components... "
if package_install vlogger geoip-database libclass-dbi-mysql-perl libtimedate-perl; then if apt_install vlogger geoip-database libclass-dbi-mysql-perl libtimedate-perl; then
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
else else
echo -e "[${red}FAILED${NC}]" echo -e "[${red}FAILED${NC}]"
...@@ -17,7 +17,7 @@ InstallWebStats() { ...@@ -17,7 +17,7 @@ InstallWebStats() {
if [ "$CFG_WEBSTATS" == "yes" ]; then if [ "$CFG_WEBSTATS" == "yes" ]; then
echo -n -e "$IDENTATION_LVL_1 Installing AWFFull... " echo -n -e "$IDENTATION_LVL_1 Installing AWFFull... "
if package_install awffull; then if apt_install awffull; then
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
else else
echo -e "[${red}FAILED${NC}]" echo -e "[${red}FAILED${NC}]"
...@@ -33,7 +33,7 @@ InstallWebStats() { ...@@ -33,7 +33,7 @@ InstallWebStats() {
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Installing AWStats... " echo -n -e "$IDENTATION_LVL_1 Installing AWStats... "
if package_install awstats; then if apt_install awstats; then
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
else else
echo -e "[${red}FAILED${NC}]" echo -e "[${red}FAILED${NC}]"
...@@ -55,7 +55,7 @@ InstallWebStats() { ...@@ -55,7 +55,7 @@ InstallWebStats() {
if wget -O - https://deb.goaccess.io/gnugpg.key | gpg --dearmor | tee /usr/share/keyrings/goaccess.gpg >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 && \ if wget -O - https://deb.goaccess.io/gnugpg.key | gpg --dearmor | tee /usr/share/keyrings/goaccess.gpg >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 && \
echo "deb [signed-by=/usr/share/keyrings/goaccess.gpg arch=$(dpkg --print-architecture)] https://deb.goaccess.io/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/goaccess.list && \ echo "deb [signed-by=/usr/share/keyrings/goaccess.gpg arch=$(dpkg --print-architecture)] https://deb.goaccess.io/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/goaccess.list && \
hide_output apt-get update && \ hide_output apt-get update && \
package_install goaccess; then apt_install goaccess; then
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
else else
echo -e "[${red}FAILED${NC}]" echo -e "[${red}FAILED${NC}]"
......
...@@ -3,13 +3,21 @@ ...@@ -3,13 +3,21 @@
# Check Installed Linux Version # Check Installed Linux Version
#--------------------------------------------------------------------- #---------------------------------------------------------------------
LOG_SPACER=" "
LOG_SPACER_SIGNS="======="
LOG_SPACER_SIGNS_END="===================================="
function log_message() {
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS $1 $LOG_SPACER_SIGNS" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
}
# Adapted from: https://github.com/mail-in-a-box/mailinabox/blob/master/setup/functions.sh#L1 # Adapted from: https://github.com/mail-in-a-box/mailinabox/blob/master/setup/functions.sh#L1
function hide_output { function hide_output {
# This function hides the output of a command unless the command fails # This function hides the output of a command unless the command fails
# and returns a non-zero exit code. # and returns a non-zero exit code.
# Get a temporary file. # Get a temporary file
OUTPUT=$(tempfile) OUTPUT=$(mktemp)
# Execute command, redirecting stderr/stdout to the temporary file. # Execute command, redirecting stderr/stdout to the temporary file.
$@ &> $OUTPUT $@ &> $OUTPUT
...@@ -17,16 +25,22 @@ function hide_output { ...@@ -17,16 +25,22 @@ function hide_output {
# If the command failed, show the output that was captured in the temporary file. # If the command failed, show the output that was captured in the temporary file.
E=$? E=$?
if [ $E != 0 ]; then if [ $E != 0 ]; then
# Something failed. # Something failed
echo echo
echo FAILED: $@ echo FAILED: $@
echo ----------------------------------------- echo -----------------------------------------
cat $OUTPUT cat $OUTPUT
echo ----------------------------------------- echo -----------------------------------------
# The error output is also written to the log file
log_message "ERROR: $@"
cat $OUTPUT >> $LOG_FILE
log_message "ERROR END"
# Remove temporary file
rm -f $OUTPUT
exit $E exit $E
fi fi
# Remove temporary file. # Remove temporary file
rm -f $OUTPUT rm -f $OUTPUT
} }
...@@ -44,6 +58,23 @@ function apt_get_quiet { ...@@ -44,6 +58,23 @@ function apt_get_quiet {
DEBIAN_FRONTEND=noninteractive hide_output apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" "$@" DEBIAN_FRONTEND=noninteractive hide_output apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" "$@"
} }
# Update Package(s)
function apt_update {
log_message "UPDATE PACKAGES START"
apt-get update >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
log_message "UPDATE PACKAGES COMPLETE"
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS_END \n" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
}
# Upgrade(s)
function apt_upgrade {
log_message "UPGRADE PACKAGES START"
apt-get -yqq upgrade >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
log_message "UPGRADE PACKAGES COMPLETE"
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS_END \n" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
}
# Install Package(s)
function apt_install { function apt_install {
# Install a bunch of packages. We used to report which packages were already # Install a bunch of packages. We used to report which packages were already
# installed and which needed installing, before just running an 'apt-get # installed and which needed installing, before just running an 'apt-get
...@@ -51,12 +82,41 @@ function apt_install { ...@@ -51,12 +82,41 @@ function apt_install {
# and doesn't affect what we actually do, except in the messages, so let's # and doesn't affect what we actually do, except in the messages, so let's
# not do that anymore. # not do that anymore.
PACKAGES=$@ PACKAGES=$@
log_message "INSTALL PACKAGES START"
log_message "Installing: $PACKAGES"
apt_get_quiet install $PACKAGES apt_get_quiet install $PACKAGES
#hide_output apt-get -y install "$@" log_message "INSTALL PACKAGES COMPLETE"
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS_END \n" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
} }
# Remove Package(s)
function apt_remove { function apt_remove {
hide_output apt-get -y remove "$@" PACKAGES=$@
log_message "REMOVE PACKAGES START"
log_message "Removing: $PACKAGES"
apt-get -yqq remove "$@" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
log_message "REMOVE PACKAGES COMPLETE"
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS_END \n" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
}
# Uninstall Package(s)
function apt_uninstall {
PACKAGES=$@
log_message "UNINSTALL PACKAGES START"
log_message "Uninstalling: $PACKAGES"
apt-get -yqq purge "$@" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
log_message "UNINSTALL PACKAGES COMPLETE"
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS_END \n" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
}
# Remove Package(s)
function apt_purge_remove {
PACKAGES=$@
log_message "REMOVE AND PURGE PACKAGES START"
log_message "Removing and purging: $PACKAGES"
apt-get -yqq remove --purge "$@" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
log_message "REMOVE AND PURGE PACKAGES COMPLETE"
echo -e "$LOG_SPACER $LOG_SPACER_SIGNS_END \n" >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
} }
function apt_add_repository_to_unattended_upgrades { function apt_add_repository_to_unattended_upgrades {
...@@ -68,6 +128,14 @@ function apt_add_repository_to_unattended_upgrades { ...@@ -68,6 +128,14 @@ function apt_add_repository_to_unattended_upgrades {
fi fi
} }
function restart_service {
hide_output service $1 restart
}
function stop_service {
hide_output service $1 stop
}
function get_default_hostname { function get_default_hostname {
# Guess the machine's hostname. It should be a fully qualified # Guess the machine's hostname. It should be a fully qualified
# domain name suitable for DNS. None of these calls may provide # domain name suitable for DNS. None of these calls may provide
...@@ -151,14 +219,6 @@ function ufw_allow { ...@@ -151,14 +219,6 @@ function ufw_allow {
fi fi
} }
function restart_service {
hide_output service $1 restart
}
function stop_service {
hide_output service $1 stop
}
## Dialog Functions ## ## Dialog Functions ##
function message_box { function message_box {
dialog --title "$1" --msgbox "$2" 0 0 dialog --title "$1" --msgbox "$2" 0 0
......
...@@ -48,12 +48,12 @@ echo -e " - ${BWhite}SQLs:${NC} ${BBlack}tmp/sqls${NC} [ ${green}DONE${NC} ...@@ -48,12 +48,12 @@ echo -e " - ${BWhite}SQLs:${NC} ${BBlack}tmp/sqls${NC} [ ${green}DONE${NC}
echo -e " - ${BWhite}Downloads:${NC} ${BBlack}tmp/downloads${NC} [ ${green}DONE${NC} ]" echo -e " - ${BWhite}Downloads:${NC} ${BBlack}tmp/downloads${NC} [ ${green}DONE${NC} ]"
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Setup Logging Files${NC}" echo -n -e "$IDENTATION_LVL_0 ${BWhite}Setup Logging Files${NC}"
exec > >(tee -i tmp/logs/ispconfig_setup.log) exec > >(tee -i tmp/logs/wt_server_setup_programs.log)
exec 2>&1 exec 2>&1
PROGRAMS_INSTALL_DOWNLOAD=$PWD/tmp/downloads PROGRAMS_INSTALL_DOWNLOAD=$PWD/tmp/downloads
PROGRAMS_INSTALL_SQLS=$PWD/tmp/sqls PROGRAMS_INSTALL_SQLS=$PWD/tmp/sqls
PROGRAMS_INSTALL_LOG_FILES=$PWD/tmp/logs/ispconfig_setup_programs.log PROGRAMS_INSTALL_LOG_FILES=$PWD/tmp/logs/wt_server_setup_programs.log
touch $PROGRAMS_INSTALL_LOG_FILES touch $PROGRAMS_INSTALL_LOG_FILES
echo -e "[ ${green}DONE${NC} ]" echo -e "[ ${green}DONE${NC} ]"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment