Skip to content

Commit 76028b9

Browse files
committed
Silent output and add information echos.
1 parent 519a171 commit 76028b9

File tree

1 file changed

+59
-52
lines changed

1 file changed

+59
-52
lines changed

install/hst-install-ubuntu.sh

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ set_default_lang() {
105105
bs da en fi id ka pl ro tr vi
106106
cn de es fr it nl pt-BR ru tw
107107
bg ko sr th ur"
108-
if !(echo $lang_list |grep -w $lang 1>&2>/dev/null); then
108+
if !(echo $lang_list |grep -w $lang > /dev/null 2>&1); then
109109
eval lang=$1
110110
fi
111111
}
@@ -258,24 +258,27 @@ apt-get -qq update
258258

259259
# Checking wget
260260
if [ ! -e '/usr/bin/wget' ]; then
261-
apt-get -y install wget
261+
echo "Install missing wget..."
262+
apt-get -y install wget > /dev/null 2>&1
262263
check_result $? "Can't install wget"
263264
fi
264265

265266
# Check if apt-transport-https is installed
266267
if [ ! -e '/usr/lib/apt/methods/https' ]; then
267-
apt-get -y install apt-transport-https
268+
echo "Install missing apt-transport-https..."
269+
apt-get -y install apt-transport-https > /dev/null 2>&1
268270
check_result $? "Can't install apt-transport-https"
269271
fi
270272

271273
# Check if apt-add-repository is installed
272274
if [ ! -e '/usr/bin/apt-add-repository' ]; then
273-
apt-get -y install python-software-properties
275+
echo "Install missing apt-add-repository..."
276+
apt-get -y install python-software-properties > /dev/null 2>&1
274277
check_result $? "Can't install python-software-properties"
275278
fi
276279

277280
# Checking repository availability
278-
wget -q "https://$GPG/deb_signing.key" -O /dev/null
281+
wget --quiet "https://$GPG/deb_signing.key" -O /dev/null
279282
check_result $? "No access to Hestia repository"
280283

281284
# Checking installed packages
@@ -460,15 +463,16 @@ fi
460463
#----------------------------------------------------------#
461464

462465
# Updating system
463-
apt-get -y upgrade
466+
echo "Upgrade System using apt-get..."
467+
apt-get -y upgrade > /dev/null 2>&1
464468
check_result $? 'apt-get upgrade failed'
465469

466470
# Installing nginx repo
467471
apt=/etc/apt/sources.list.d
468472
echo "deb http://nginx.org/packages/mainline/ubuntu/ $codename nginx" \
469473
> $apt/nginx.list
470-
wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
471-
apt-key add /tmp/nginx_signing.key
474+
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
475+
apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
472476

473477
if [ "$multiphp" = 'yes' ] || [ "$phpfpm" = 'yes' ]; then
474478
# Installing sury php repo
@@ -477,8 +481,8 @@ fi
477481

478482
# Installing hestia repo
479483
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
480-
wget https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
481-
apt-key add /tmp/deb_signing.key
484+
wget --quiet https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
485+
apt-key add /tmp/deb_signing.key > /dev/null 2>&1
482486

483487

484488
#----------------------------------------------------------#
@@ -652,7 +656,7 @@ fi
652656
#----------------------------------------------------------#
653657

654658
# Updating system
655-
apt-get update
659+
apt-get -qq update
656660

657661
# Disabling daemon autostart on apt-get install
658662
echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
@@ -887,10 +891,10 @@ if [ "$nginx" = 'yes' ]; then
887891
echo > /etc/nginx/conf.d/hestia.conf
888892
mkdir -p /var/log/nginx/domains
889893
if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
890-
update-rc.d php5.6-fpm defaults
891-
update-rc.d php7.0-fpm defaults
892-
update-rc.d php7.1-fpm defaults
893-
update-rc.d php7.2-fpm defaults
894+
update-rc.d php5.6-fpm defaults > /dev/null 2>&1
895+
update-rc.d php7.0-fpm defaults > /dev/null 2>&1
896+
update-rc.d php7.1-fpm defaults > /dev/null 2>&1
897+
update-rc.d php7.2-fpm defaults > /dev/null 2>&1
894898
cp -r /etc/php/5.6/ /root/hst_install_backups/php5.6/
895899
rm -f /etc/php/5.6/fpm/pool.d/*
896900
cp -r /etc/php/7.0/ /root/hst_install_backups/php7.0/
@@ -906,11 +910,11 @@ if [ "$nginx" = 'yes' ]; then
906910
ln -s $HESTIA/data/templates/web/nginx/PHP-72.tpl $HESTIA/data/templates/web/nginx/default.tpl
907911
ln -s $HESTIA/data/templates/web/nginx/PHP-72.stpl $HESTIA/data/templates/web/nginx/default.stpl
908912
chmod a+x $HESTIA/data/templates/web/nginx/*.sh
909-
service php7.2-fpm start
913+
service php7.2-fpm start > /dev/null 2>&1
910914
check_result $? "php7.2-fpm start failed"
911915
fi
912-
update-rc.d nginx defaults
913-
service nginx start
916+
update-rc.d nginx defaults > /dev/null 2>&1
917+
service nginx start > /dev/null 2>&1
914918
check_result $? "nginx start failed"
915919
fi
916920

@@ -923,11 +927,11 @@ if [ "$apache" = 'yes' ]; then
923927
cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
924928
cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
925929
cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
926-
a2enmod rewrite
927-
a2enmod suexec
928-
a2enmod ssl
929-
a2enmod actions
930-
a2enmod ruid2
930+
a2enmod rewrite > /dev/null 2>&1
931+
a2enmod suexec > /dev/null 2>&1
932+
a2enmod ssl > /dev/null 2>&1
933+
a2enmod actions > /dev/null 2>&1
934+
a2enmod ruid2 > /dev/null 2>&1
931935
mkdir -p /etc/apache2/conf.d
932936
echo > /etc/apache2/conf.d/hestia.conf
933937
echo "# Powered by hestia" > /etc/apache2/sites-available/default
@@ -940,15 +944,15 @@ if [ "$apache" = 'yes' ]; then
940944
chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
941945
chmod 751 /var/log/apache2/domains
942946
if [ "$multiphp" = 'yes' ] ; then
943-
a2enmod proxy_fcgi setenvif
944-
a2enconf php5.6-fpm
945-
a2enconf php7.0-fpm
946-
a2enconf php7.1-fpm
947-
a2enconf php7.2-fpm
948-
update-rc.d php5.6-fpm defaults
949-
update-rc.d php7.0-fpm defaults
950-
update-rc.d php7.1-fpm defaults
951-
update-rc.d php7.2-fpm defaults
947+
a2enmod proxy_fcgi setenvif > /dev/null 2>&1
948+
a2enconf php5.6-fpm > /dev/null 2>&1
949+
a2enconf php7.0-fpm > /dev/null 2>&1
950+
a2enconf php7.1-fpm > /dev/null 2>&1
951+
a2enconf php7.2-fpm > /dev/null 2>&1
952+
update-rc.d php5.6-fpm defaults > /dev/null 2>&1
953+
update-rc.d php7.0-fpm defaults > /dev/null 2>&1
954+
update-rc.d php7.1-fpm defaults > /dev/null 2>&1
955+
update-rc.d php7.2-fpm defaults > /dev/null 2>&1
952956
cp -r /etc/php/5.6/ /root/vst_install_backups/php5.6/
953957
rm -f /etc/php/5.6/fpm/pool.d/*
954958
cp -r /etc/php/7.0/ /root/vst_install_backups/php7.0/
@@ -960,12 +964,12 @@ if [ "$apache" = 'yes' ]; then
960964
cp -f $hestiacp/multiphp/apache2/* $HESTIA/data/templates/web/apache2/
961965
chmod a+x $HESTIA/data/templates/web/apache2/*.sh
962966
fi
963-
update-rc.d apache2 defaults
964-
service apache2 start
967+
update-rc.d apache2 defaults > /dev/null 2>&1
968+
service apache2 start > /dev/null 2>&1
965969
check_result $? "apache2 start failed"
966970
else
967-
update-rc.d apache2 disable >/dev/null 2>&1
968-
service apache2 stop >/dev/null 2>&1
971+
update-rc.d apache2 disable > /dev/null 2>&1
972+
service apache2 stop > /dev/null 2>&1
969973
fi
970974

971975

@@ -975,8 +979,8 @@ fi
975979

976980
if [ "$phpfpm" = 'yes' ]; then
977981
cp -f $hestiacp/php-fpm/www.conf /etc/php/7.2/fpm/pool.d/www.conf
978-
update-rc.d php7.2-fpm defaults
979-
service php7.2-fpm start
982+
update-rc.d php7.2-fpm defaults > /dev/null 2>&1
983+
service php7.2-fpm start > /dev/null 2>&1
980984
check_result $? "php-fpm start failed"
981985
fi
982986

@@ -1021,8 +1025,8 @@ fi
10211025
if [ "$proftpd" = 'yes' ]; then
10221026
echo "127.0.0.1 $servername" >> /etc/hosts
10231027
cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
1024-
update-rc.d proftpd defaults
1025-
service proftpd start
1028+
update-rc.d proftpd defaults > /dev/null 2>&1
1029+
service proftpd start > /dev/null 2>&1
10261030
check_result $? "proftpd start failed"
10271031
fi
10281032

@@ -1043,7 +1047,7 @@ if [ "$mysql" = 'yes' ]; then
10431047
# Configuring MySQL/MariaDB
10441048
cp -f $hestiacp/mysql/$mycnf /etc/mysql/my.cnf
10451049
if [ "$release" = '14.04' ]; then
1046-
mysql_install_db >/dev/null 2>&1
1050+
mysql_install_db > /dev/null 2>&1
10471051
fi
10481052
if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
10491053
if [ -e '/etc/init.d/mysql' ]; then
@@ -1054,7 +1058,7 @@ if [ "$mysql" = 'yes' ]; then
10541058
mkdir -p /var/lib/mysql
10551059
fi
10561060
chown mysql:mysql /var/lib/mysql
1057-
mysqld --initialize-insecure >/dev/null 2>&1
1061+
mysqld --initialize-insecure > /dev/null 2>&1
10581062
fi
10591063
fi
10601064
update-rc.d mysql defaults
@@ -1063,7 +1067,7 @@ if [ "$mysql" = 'yes' ]; then
10631067

10641068
# Securing MySQL/MariaDB installation
10651069
mpass=$(gen_pass)
1066-
mysqladmin -u root password $mpass
1070+
mysqladmin -u root password $mpass > /dev/null 2>&1
10671071
echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
10681072
chmod 600 /root/.my.cnf
10691073
if [ "$release" = '16.04' ]; then
@@ -1096,8 +1100,11 @@ fi
10961100
# Update phpMyAdmin #
10971101
#----------------------------------------------------------#
10981102

1103+
# Show Upgrade Information
1104+
echo "Upgrade phpMyAdmin to v$pma_v..."
1105+
10991106
# Download latest phpmyadmin release
1100-
wget https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
1107+
wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
11011108

11021109
# Unpack files
11031110
tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
@@ -1150,9 +1157,9 @@ if [ "$named" = 'yes' ]; then
11501157
sed -i "s%listen-on%//listen%" /etc/bind/named.conf.options
11511158
chown root:bind /etc/bind/named.conf
11521159
chmod 640 /etc/bind/named.conf
1153-
aa-complain /usr/sbin/named 2>/dev/null
1160+
aa-complain /usr/sbin/named > /dev/null 2>&1
11541161
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2>/dev/null
1155-
service apparmor status >/dev/null 2>&1
1162+
service apparmor status > /dev/null 2>&1
11561163
if [ $? -ne 0 ]; then
11571164
service apparmor restart
11581165
fi
@@ -1171,7 +1178,7 @@ fi
11711178
#----------------------------------------------------------#
11721179

11731180
if [ "$exim" = 'yes' ]; then
1174-
gpasswd -a Debian-exim mail
1181+
gpasswd -a Debian-exim mail > /dev/null 2>&1
11751182
cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
11761183
cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
11771184
cp -f $hestiacp/exim/spam-blocks.conf /etc/exim4/
@@ -1206,7 +1213,7 @@ fi
12061213
#----------------------------------------------------------#
12071214

12081215
if [ "$dovecot" = 'yes' ]; then
1209-
gpasswd -a dovecot mail
1216+
gpasswd -a dovecot mail > /dev/null 2>&1
12101217
cp -rf $hestiacp/dovecot /etc/
12111218
cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
12121219
if [ "$release" = '18.04' ]; then
@@ -1224,8 +1231,8 @@ fi
12241231
#----------------------------------------------------------#
12251232

12261233
if [ "$clamd" = 'yes' ]; then
1227-
gpasswd -a clamav mail
1228-
gpasswd -a clamav Debian-exim
1234+
gpasswd -a clamav mail > /dev/null 2>&1
1235+
gpasswd -a clamav Debian-exim > /dev/null 2>&1
12291236
cp -f $hestiacp/clamav/clamd.conf /etc/clamav/
12301237
update-rc.d clamav-daemon defaults
12311238
service clamav-daemon start
@@ -1241,9 +1248,9 @@ fi
12411248
#----------------------------------------------------------#
12421249

12431250
if [ "$spamd" = 'yes' ]; then
1244-
update-rc.d spamassassin defaults
1251+
update-rc.d spamassassin defaults > /dev/null 2>&1
12451252
sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
1246-
service spamassassin start
1253+
service spamassassin start > /dev/null 2>&1
12471254
check_result $? "spamassassin start failed"
12481255
unit_files="$(systemctl list-unit-files |grep spamassassin)"
12491256
if [[ "$unit_files" =~ "disabled" ]]; then

0 commit comments

Comments
 (0)