SSH/Xterm does not support Whiptail with infoboxes.
Added " TERM=ansi" to correct this problem.
This commit is contained in:
b.waal
2019-09-17 13:28:00 +02:00
parent 663ced9791
commit 4bbd8e21aa

View File

@@ -24,7 +24,6 @@ PKGI="${PKGM} install -y"
if [ $IMODE = n ]; then if [ $IMODE = n ]; then
TERM=ansi whiptail --title "Ubuntu 18.04 Mail Installer" --infobox "" 8 45 TERM=ansi whiptail --title "Ubuntu 18.04 Mail Installer" --infobox "" 8 45
sleep 3
if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno "Do you want to install a mail server?" 8 78) if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno "Do you want to install a mail server?" 8 78)
then then
echo "" >/dev/null echo "" >/dev/null
@@ -66,11 +65,8 @@ debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Si
##----------------## ##----------------##
# Pre-Config # # Pre-Config #
##----------------## ##----------------##
{ for ((i = 0 ; i <= 100 ; i+=5)); do sleep 0.2 TERM=ansi whiptail --title "Pre-ConfiguringL" --infobox "Busy like a bee" 8 45
echo $i sleep 2
done
} | whiptail --gauge "Pre-configuring the server..." 6 50 0
hostnamectl set-hostname $domain > $OUTPUT 2>&1 hostnamectl set-hostname $domain > $OUTPUT 2>&1
timedatectl set-timezone Europe/Amsterdam > $OUTPUT 2>&1 timedatectl set-timezone Europe/Amsterdam > $OUTPUT 2>&1
#adduser --system --no-create-home --disabled-password --disabled-login --shell /bin/false --group --home /var/lib/clamav clamav #adduser --system --no-create-home --disabled-password --disabled-login --shell /bin/false --group --home /var/lib/clamav clamav
@@ -98,7 +94,7 @@ $PKGI software-properties-common
$PKGA universe -y > $OUTPUT 2>&1 $PKGA universe -y > $OUTPUT 2>&1
$PKGA ppa:ondrej/php -y > $OUTPUT 2>&1 $PKGA ppa:ondrej/php -y > $OUTPUT 2>&1
wget -q -O- https://repo.dovecot.org/DOVECOT-REPO-GPG | sudo apt-key add - wget -q -O- https://repo.dovecot.org/DOVECOT-REPO-GPG | sudo apt-key add -
echo "deb https://repo.dovecot.org/ce-2.3-latest/ubuntu/$(lsb_release -cs) $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/dovecot.list echo "deb https://repo.dovecot.org/ce-2.3-latest/ubuntu/$(lsb_release -cs) $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/dovecot.list > $OUTPUT 2>&1
$PKGM update $PKGM update
$PKGM upgrade -y $PKGM upgrade -y
@@ -246,10 +242,7 @@ systemctl restart nginx
##-----------------------## ##-----------------------##
# MySQL Installation # # MySQL Installation #
##-----------------------## ##-----------------------##
{ for ((i = 0 ; i <= 100 ; i+=5)); do sleep 0.2 TERM=ansi whiptail --title "Installing MySQL" --infobox "Busy like a bee" 8 45
echo $i
done
} | whiptail --gauge "Installing MySQL..." 6 50 0
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-MySQL/raw/branch/master/mysql-8.0.sh -O /tmp/mysql-8.0.sh wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-MySQL/raw/branch/master/mysql-8.0.sh -O /tmp/mysql-8.0.sh
source /tmp/mysql-8.0.sh source /tmp/mysql-8.0.sh
@@ -257,10 +250,7 @@ source /tmp/mysql-8.0.sh
##------------------------------## ##------------------------------##
# MySQL_Secure_Installation # # MySQL_Secure_Installation #
##------------------------------## ##------------------------------##
{ for ((i = 0 ; i <= 100 ; i+=5)); do sleep 0.2 TERM=ansi whiptail --title "Securing MySQL" --infobox "Busy like a bee" 8 45
echo $i
done
} | whiptail --gauge "Securing MySQL..." 6 50 0
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" > $OUTPUT 2>&1
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User=''" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User=''" > $OUTPUT 2>&1
@@ -272,10 +262,7 @@ mysql -u root -p"$password" -e "FLUSH PRIVILEGES;" > $OUTPUT 2>&1
##-----------------------------## ##-----------------------------##
# MySQL Database Creation # # MySQL Database Creation #
##-----------------------------## ##-----------------------------##
{ for ((i = 0 ; i <= 100 ; i+=5)); do sleep 0.2 TERM=ansi whiptail --title "Creating MySQL Databases" --infobox "Busy like a bee" 8 45
echo $i
done
} | whiptail --gauge "Creating MySQL Databases..." 6 50 0
mysql -u root -p"$password" -e "CREATE DATABASE postfixadmin;" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "CREATE DATABASE postfixadmin;" > $OUTPUT 2>&1
mysql -u root -p"$password" -e "CREATE USER '"postfixadmin"'@'localhost' IDENTIFIED BY '"$password"';" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "CREATE USER '"postfixadmin"'@'localhost' IDENTIFIED BY '"$password"';" > $OUTPUT 2>&1
mysql -u root -p"$password" -e "GRANT ALL ON "postfixadmin".* TO "postfixadmin"@'localhost';" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "GRANT ALL ON "postfixadmin".* TO "postfixadmin"@'localhost';" > $OUTPUT 2>&1
@@ -287,10 +274,7 @@ mysql -u root -p"$password" -e "FLUSH PRIVILEGES;" > $OUTPUT 2>&1
$PKGI postfix postfix-mysql $PKGI postfix postfix-mysql
#$PKGI php${phpver} php${phpver}-zip php${phpver}-fpm php${phpver}-cli php${phpver}-json php${phpver}-mysql php${phpver}-opcache php${phpver}-mbstring php${phpver}-readline #$PKGI php${phpver} php${phpver}-zip php${phpver}-fpm php${phpver}-cli php${phpver}-json php${phpver}-mysql php${phpver}-opcache php${phpver}-mbstring php${phpver}-readline
#$PKGI libc-client2007e mlock php${phpver}-common php${phpver}-imap #$PKGI libc-client2007e mlock php${phpver}-common php${phpver}-imap
{ for ((i = 0 ; i <= 100 ; i+=5)); do sleep 0.2 TERM=ansi whiptail --title "Configuring PostfixAdmin" --infobox "Busy like a bee" 8 45
echo $i
done
} | whiptail --gauge "Configuring PostfixAdmin..." 6 50 0
mkdir -p /var/www/"$domain"/html/postfixadmin/templates_c mkdir -p /var/www/"$domain"/html/postfixadmin/templates_c
wget -q -t7 https://git.ictmaatwerk.com/downloads/pfa/postfixadmin-3.1.tar.gz -O /tmp/postfixadmin.tar.gz wget -q -t7 https://git.ictmaatwerk.com/downloads/pfa/postfixadmin-3.1.tar.gz -O /tmp/postfixadmin.tar.gz
tar -xf /tmp/postfixadmin.tar.gz -C /var/www/"$domain"/html/postfixadmin --strip-components=1 tar -xf /tmp/postfixadmin.tar.gz -C /var/www/"$domain"/html/postfixadmin --strip-components=1