@@ -29,41 +29,48 @@ is_format_valid 'service' 'restart'
2929# Action #
3030# ----------------------------------------------------------#
3131
32- if [ " $service " = " iptables" ]; then
33- # Run the restart rules for iptables firewall
34- $BIN /v-stop-firewall
35- $BIN /v-update-firewall
36- elif [ -z " $restart " -o " $restart " = " no" ] && [ \
37- " $service " = " nginx" -o \
38- " $service " = " apache2" -o \
39- " $service " = " exim4" -o \
40- " $service " = " dovecot" -o \
41- " $service " = " bind9" -o \
42- " $service " = " named" -o \
43- " $service " = " vsftpd" -o \
44- " $service " = " php5.6-fpm" -o \
45- " $service " = " php7.0-fpm" -o \
46- " $service " = " php7.1-fpm" -o \
47- " $service " = " php7.2-fpm" -o \
48- " $service " = " php7.3-fpm" -o \
49- " $service " = " proftpd" -o \
50- " $service " = " ssh" -o \
51- " $service " = " fail2ban" ]; then
52- systemctl reload-or-restart $service > /dev/null 2>&1
32+ if [ " $service " = " php-fpm" ]; then
33+ for php_ver in $( multiphp_versions) ; do
34+ service_list=" ${service_list} php${php_ver} -fpm"
35+ done
5336else
54- systemctl reset-failed $service > /dev/null 2>&1
55- systemctl restart $service > /dev/null 2>&1
37+ service_list=" $service "
5638fi
5739
58- # ----------------------------------------------------------#
59- # Hestia #
60- # ----------------------------------------------------------#
40+ for service in $service_list ; do
6141
62- # Check the result of the service restart and report whether it failed.
63- if [ $? -ne 0 ]; then
64- check_result $E_RESTART " ERROR: Restart of $service failed."
65- log_history " Restart of $service failed."
66- fi
42+ if [ " $service " = " iptables" ]; then
43+ # Run the restart rules for iptables firewall
44+ $BIN /v-stop-firewall
45+ $BIN /v-update-firewall
46+ elif [ -z " $restart " -o " $restart " = " no" ] && [ \
47+ " $service " = " nginx" -o \
48+ " $service " = " apache2" -o \
49+ " $service " = " exim4" -o \
50+ " $service " = " dovecot" -o \
51+ " $service " = " bind9" -o \
52+ " $service " = " named" -o \
53+ " $service " = " vsftpd" -o \
54+ " $service " = " php5.6-fpm" -o \
55+ " $service " = " php7.0-fpm" -o \
56+ " $service " = " php7.1-fpm" -o \
57+ " $service " = " php7.2-fpm" -o \
58+ " $service " = " php7.3-fpm" -o \
59+ " $service " = " proftpd" -o \
60+ " $service " = " ssh" -o \
61+ " $service " = " fail2ban" ]; then
62+ systemctl reload-or-restart $service > /dev/null 2>&1
63+ else
64+ systemctl reset-failed $service > /dev/null 2>&1
65+ systemctl restart $service > /dev/null 2>&1
66+ fi
67+
68+ # Check the result of the service restart and report whether it failed.
69+ if [ $? -ne 0 ]; then
70+ check_result $E_RESTART " ERROR: Restart of $service failed."
71+ log_history " Restart of $service failed."
72+ fi
73+ done
6774
6875# Logging
6976log_event " $OK " " $ARGUMENTS "
0 commit comments