Skip to content

Commit ef222e1

Browse files
author
Kristan Kenney
committed
Fix formatting of status messages during clean installation
1 parent 1b12c0b commit ef222e1

File tree

2 files changed

+106
-66
lines changed

2 files changed

+106
-66
lines changed

install/hst-install-debian.sh

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,16 @@ echo ' | _ | __/\__ \ |_| | (_| | |___| __/ '
406406
echo ' |_| |_|\___||___/\__|_|\__,_|\____|_| '
407407
echo
408408
echo ' Hestia Control Panel'
409-
echo -e "\n\n"
410-
411-
echo 'The following software will be installed on your system:'
409+
echo ' v1.0.1'
410+
echo -e "\n"
411+
echo "=============================================================================="
412+
echo -e "\n"
413+
echo 'The following server components will be installed on your system:'
414+
echo
412415

413416
# Web stack
414417
if [ "$nginx" = 'yes' ]; then
415-
echo ' - Nginx Web Server'
418+
echo ' - NGINX Web / Proxy Server'
416419
fi
417420
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
418421
echo ' - Apache Web Server'
@@ -438,9 +441,12 @@ if [ "$exim" = 'yes' ]; then
438441
if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then
439442
echo -n ' + '
440443
if [ "$clamd" = 'yes' ]; then
441-
echo -n 'ClamAV'
444+
echo -n 'ClamAV '
442445
fi
443446
if [ "$spamd" = 'yes' ]; then
447+
if [ "$clamd" = 'yes' ]; then
448+
echo -n '+ '
449+
fi
444450
echo -n 'SpamAssassin'
445451
fi
446452
fi
@@ -471,13 +477,15 @@ if [ "$iptables" = 'yes' ]; then
471477
echo -n ' - Iptables Firewall'
472478
fi
473479
if [ "$iptables" = 'yes' ] && [ "$fail2ban" = 'yes' ]; then
474-
echo -n ' + Fail2Ban'
480+
echo -n ' + Fail2Ban Access Monitor'
475481
fi
476-
echo -e "\n\n"
482+
echo -e "\n"
483+
echo "=============================================================================="
484+
echo -e "\n"
477485

478486
# Asking for confirmation to proceed
479487
if [ "$interactive" = 'yes' ]; then
480-
read -p 'Would you like to continue? [y/n]: ' answer
488+
read -p 'Would you like to continue with the installation? [Y/N]: ' answer
481489
if [ "$answer" != 'y' ] && [ "$answer" != 'Y' ]; then
482490
echo 'Goodbye'
483491
exit 1
@@ -522,7 +530,7 @@ if [ -z "$email" ]; then
522530
fi
523531

524532
# Defining backup directory
525-
echo -e "\nInstallation backup directory: $hst_backups"
533+
echo -e "Installation backup directory: $hst_backups"
526534

527535
# Print Log File Path
528536
echo "Installation log file: $LOG"
@@ -571,23 +579,32 @@ check_result $? 'apt-get upgrade failed'
571579
apt=/etc/apt/sources.list.d
572580

573581
# Updating system
574-
echo "Installing required repository keys... "
575-
582+
echo "Adding required repositories to proceed with installation:"
583+
echo
576584
# Installing nginx repo
577585
echo "(*) NGINX"
586+
if [ -e $apt/nginx.list ]; then
587+
rm $apt/nginx.list
588+
fi
578589
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" \
579590
> $apt/nginx.list
580591
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
581592
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
582593

583594
# Installing sury php repo
584595
echo "(*) PHP"
596+
if [ -e $apt/php.list ]; then
597+
rm $apt/php.list
598+
fi
585599
echo "deb https://packages.sury.org/php/ $codename main" > $apt/php.list
586600
wget --quiet https://packages.sury.org/php/apt.gpg -O /tmp/php_signing.key
587601
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/php_signing.key > /dev/null 2>&1
588602

589603
# Installing MariaDB repo
590604
echo "(*) MariaDB"
605+
if [ -e $apt/mariadb.list ]; then
606+
rm $apt/mariadb.list
607+
fi
591608
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/$VERSION $codename main" > $apt/mariadb.list
592609
if [ "$release" -eq 8 ]; then
593610
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
@@ -607,10 +624,13 @@ fi
607624

608625
# Installing hestia repo
609626
echo "(*) Hestia Control Panel"
627+
if [ -e $apt/hestia.list ]; then
628+
rm $apt/hestia.list
629+
fi
610630
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
611631
wget --quiet https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
612632
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/deb_signing.key > /dev/null 2>&1
613-
633+
echo
614634

615635
#----------------------------------------------------------#
616636
# Backup #
@@ -845,8 +865,9 @@ echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
845865
chmod a+x /usr/sbin/policy-rc.d
846866

847867
# Installing apt packages
848-
echo "Installing Hestia Control Panel and required dependencies..."
868+
echo "Now installing Hestia Control Panel and all required dependencies."
849869
echo -ne "NOTE: This process may take 10 to 15 minutes to complete, please wait... "
870+
echo
850871
apt-get -y install $software > /dev/null 2>&1 &
851872
BACK_PID=$!
852873

@@ -888,7 +909,7 @@ rm -f /usr/sbin/policy-rc.d
888909
# Configure system #
889910
#----------------------------------------------------------#
890911

891-
echo "Configure System"
912+
echo "(*) Configuring system settings..."
892913
# Enable SSH password authentication
893914
sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
894915

@@ -944,7 +965,7 @@ chmod 755 /usr/bin/rssh
944965
# Configure Hestia #
945966
#----------------------------------------------------------#
946967

947-
echo "Configure Hestia"
968+
echo "(*) Configuring Hestia Control Panel..."
948969
# Installing sudo configuration
949970
mkdir -p /etc/sudoers.d
950971
cp -f $hestiacp/sudo/admin /etc/sudoers.d/
@@ -1090,7 +1111,7 @@ cp -rf $hestiacp/firewall $HESTIA/data/
10901111
$HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
10911112

10921113
# Generating SSL certificate
1093-
echo "Generate ssl certificate"
1114+
echo "(*) Generating default self-signed SSL certificate..."
10941115
$HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
10951116
'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
10961117

@@ -1114,7 +1135,7 @@ rm /tmp/hst.pem
11141135
#----------------------------------------------------------#
11151136

11161137
if [ "$nginx" = 'yes' ]; then
1117-
echo "Configure Nginx Webserver"
1138+
echo "(*) Configuring NGINX..."
11181139
rm -f /etc/nginx/conf.d/*.conf
11191140
cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
11201141
cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
@@ -1124,7 +1145,7 @@ if [ "$nginx" = 'yes' ]; then
11241145
mkdir -p /etc/nginx/conf.d/domains
11251146
mkdir -p /var/log/nginx/domains
11261147
if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
1127-
echo "Configure Nginx MultiPHP"
1148+
echo "(*) Configuring Multi-PHP..."
11281149
rm -fr $HESTIA/data/templates/web/nginx/*
11291150
for v in "${multiphp_v[@]}"; do
11301151
update-rc.d php$v-fpm defaults > /dev/null 2>&1
@@ -1170,7 +1191,7 @@ fi
11701191
#----------------------------------------------------------#
11711192

11721193
if [ "$apache" = 'yes' ]; then
1173-
echo "Configure Apache Webserver"
1194+
echo "(*) Configuring Apache Web Server..."
11741195
cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
11751196
cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
11761197
cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
@@ -1222,7 +1243,7 @@ fi
12221243
#----------------------------------------------------------#
12231244

12241245
if [ "$phpfpm" = 'yes' ]; then
1225-
echo "Configure PHP-FPM"
1246+
echo "(*) Configuring PHP-FPM..."
12261247
cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
12271248
update-rc.d php$fpm_v-fpm defaults > /dev/null 2>&1
12281249
service php$fpm_v-fpm start >> $LOG
@@ -1234,7 +1255,7 @@ fi
12341255
# Configure PHP #
12351256
#----------------------------------------------------------#
12361257

1237-
echo "Configure PHP Timezone"
1258+
echo "(*) Configuring PHP..."
12381259
ZONE=$(timedatectl > /dev/null 2>&1|grep Timezone|awk '{print $2}')
12391260
if [ -z "$ZONE" ]; then
12401261
ZONE='UTC'
@@ -1256,7 +1277,7 @@ chmod 755 /etc/cron.daily/php-session-cleanup
12561277
#----------------------------------------------------------#
12571278

12581279
if [ "$vsftpd" = 'yes' ]; then
1259-
echo "Configure Vsftpd"
1280+
echo "(*) Configuring Vsftpd server..."
12601281
cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
12611282
touch /var/log/vsftpd.log
12621283
chown root:adm /var/log/vsftpd.log
@@ -1276,7 +1297,7 @@ fi
12761297
#----------------------------------------------------------#
12771298

12781299
if [ "$proftpd" = 'yes' ]; then
1279-
echo "Configure ProFTPD server"
1300+
echo "(*) Configuring ProFTPD server..."
12801301
echo "127.0.0.1 $servername" >> /etc/hosts
12811302
cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
12821303
update-rc.d proftpd defaults > /dev/null 2>&1
@@ -1290,7 +1311,7 @@ fi
12901311
#----------------------------------------------------------#
12911312

12921313
if [ "$mysql" = 'yes' ]; then
1293-
echo "Configure MariaDB server"
1314+
echo "(*) Configuring MariaDB database server..."
12941315
mycnf="my-small.cnf"
12951316
if [ $memory -gt 1200000 ]; then
12961317
mycnf="my-medium.cnf"
@@ -1336,7 +1357,7 @@ fi
13361357

13371358
if [ "$mysql" = 'yes' ]; then
13381359
# Display upgrade information
1339-
echo "Installing phpMyAdmin version v$pma_v..."
1360+
echo "(*) Installing phpMyAdmin version v$pma_v..."
13401361

13411362
# Download latest phpmyadmin release
13421363
wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
@@ -1369,7 +1390,7 @@ fi
13691390
#----------------------------------------------------------#
13701391

13711392
if [ "$postgresql" = 'yes' ]; then
1372-
echo "Configure PostgreSQL database server"
1393+
echo "(*) Configuring PostgreSQL database server..."
13731394
ppass=$(gen_pass)
13741395
cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
13751396
service postgresql restart
@@ -1388,7 +1409,7 @@ fi
13881409
#----------------------------------------------------------#
13891410

13901411
if [ "$named" = 'yes' ]; then
1391-
echo "Configure Bind DNS server"
1412+
echo "(*) Configuring Bind DNS server..."
13921413
cp -f $hestiacp/bind/named.conf /etc/bind/
13931414
cp -f $hestiacp/bind/named.conf.options /etc/bind/
13941415
chown root:bind /etc/bind/named.conf
@@ -1420,7 +1441,7 @@ fi
14201441
#----------------------------------------------------------#
14211442

14221443
if [ "$exim" = 'yes' ]; then
1423-
echo "Configure Exim mail server"
1444+
echo "(*) Configuring Exim mail server..."
14241445
gpasswd -a Debian-exim mail > /dev/null 2>&1
14251446
cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
14261447
cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
@@ -1456,7 +1477,7 @@ fi
14561477
#----------------------------------------------------------#
14571478

14581479
if [ "$dovecot" = 'yes' ]; then
1459-
echo "Configure Dovecot"
1480+
echo "(*) Configuring Dovecot POP/IMAP mail server..."
14601481
gpasswd -a dovecot mail > /dev/null 2>&1
14611482
cp -rf $hestiacp/dovecot /etc/
14621483
cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
@@ -1490,7 +1511,7 @@ if [ "$clamd" = 'yes' ]; then
14901511
/lib/systemd/system/clamav-daemon.service
14911512
systemctl daemon-reload
14921513
fi
1493-
echo -ne "Installing ClamAV anti-virus definitions... "
1514+
echo -ne "(*) Installing ClamAV anti-virus definitions... "
14941515
/usr/bin/freshclam >> $LOG &
14951516
BACK_PID=$!
14961517
spin_i=1
@@ -1509,7 +1530,7 @@ fi
15091530
#----------------------------------------------------------#
15101531

15111532
if [ "$spamd" = 'yes' ]; then
1512-
echo "Configure SpamAssassin"
1533+
echo "(*) Configuring SpamAssassin..."
15131534
update-rc.d spamassassin defaults > /dev/null 2>&1
15141535
sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
15151536
service spamassassin start >> $LOG
@@ -1526,7 +1547,7 @@ fi
15261547
#----------------------------------------------------------#
15271548

15281549
if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
1529-
echo "Configure Roundcube"
1550+
echo "(*) Configuring Roundcube webmail client..."
15301551
if [ "$apache" = 'yes' ]; then
15311552
cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
15321553
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
@@ -1596,7 +1617,7 @@ fi
15961617
#----------------------------------------------------------#
15971618

15981619
if [ "$fail2ban" = 'yes' ]; then
1599-
echo "Configure Fail2Ban"
1620+
echo "(*) Configuring fail2ban access monitor..."
16001621
cp -rf $hestiacp/fail2ban /etc/
16011622
if [ "$dovecot" = 'no' ]; then
16021623
fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)

0 commit comments

Comments
 (0)