File tree Expand file tree Collapse file tree 6 files changed +12
-13
lines changed
Expand file tree Collapse file tree 6 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$SSL' "yes"
8686
8787# Restarting mail server
8888$BIN /v-restart-mail $restart
89- $BIN /v-restart-service $IMAP_SYSTEM $restart
9089check_result $? " Mail restart failed" > /dev/null
9190
9291# Restarting web server
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ add_mail_ssl_config
5757
5858# Restarting mail server
5959$BIN /v-restart-mail $restart
60- $BIN /v-restart-service $IMAP_SYSTEM $restart
6160
6261check_result $? " Mail restart failed" > /dev/null
6362
Original file line number Diff line number Diff line change @@ -61,10 +61,7 @@ cp -f $ssl_dir/certificate.key $HESTIA/ssl/certificate.key
6161# Restarting web server
6262if [ " $restart " != ' no' ]; then
6363 kill -HUP $( cat /var/run/hestia-nginx.pid)
64- $BIN /v-restart-mail
65- if [ ! -z " $IMAP_SYSTEM " ]; then
66- v-restart-service " $IMAP_SYSTEM "
67- fi
64+ $BIN /v-restart-mail $restart
6865fi
6966
7067# Logging
Original file line number Diff line number Diff line change @@ -23,11 +23,17 @@ PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
2323# ----------------------------------------------------------#
2424
2525check_args ' 1' " $# " ' SERVICE'
26+ service_status=$( pgrep $service )
2627
2728# ----------------------------------------------------------#
2829# Action #
2930# ----------------------------------------------------------#
3031
32+ # Restart service if not running instead of trying to reload
33+ if [ -z " $service_status " ]; then
34+ force=" yes"
35+ fi
36+
3137if [ " $service " = " iptables" ]; then
3238 # Run the restart rules for iptables firewall
3339 $BIN /v-stop-firewall
@@ -38,11 +44,15 @@ elif [ -z "$force" -o "$force" = "no" ] && [ \
3844 " $service " = " exim4" -o \
3945 " $service " = " dovecot" -o \
4046 " $service " = " bind9" -o \
47+ " $service " = " named" -o \
4148 " $service " = " vsftpd" -o \
49+ " $service " = " proftpd" -o \
4250 " $service " = " ssh" -o \
4351 " $service " = " fail2ban" ]; then
52+ sleep 1
4453 systemctl reload $service > /dev/null 2>&1
4554else
55+ sleep 1
4656 systemctl restart $service > /dev/null 2>&1
4757fi
4858
Original file line number Diff line number Diff line change @@ -80,11 +80,8 @@ $BIN/v-restart-proxy
8080if [ ! -z " $MAIL_SYSTEM " ]; then
8181 # Restart exim (and dovecot if applicable)
8282 $BIN /v-restart-mail
83- if [ ! -z " $IMAP_SYSTEM " ]; then
84- $BIN /v-restart-service " $IMAP_SYSTEM "
85- fi
8683fi
87- $BIN /v-restart-service " hestia"
84+ $BIN /v-restart-service hestia
8885
8986# ----------------------------------------------------------#
9087# Hestia #
Original file line number Diff line number Diff line change @@ -211,9 +211,6 @@ upgrade_restart_services() {
211211 if [ ! -z " $MAIL_SYSTEM " ]; then
212212 $BIN /v-restart-mail $restart
213213 fi
214- if [ ! -z " $IMAP_SYSTEM " ]; then
215- $BIN /v-restart-service $IMAP_SYSTEM $restart
216- fi
217214 if [ ! -z " $WEB_SYSTEM " ]; then
218215 $BIN /v-restart-web $restart
219216 $BIN /v-restart-proxy $restart
You can’t perform that action at this time.
0 commit comments