@@ -28,28 +28,30 @@ check_args '1' "$#" 'SERVICE'
2828# Action #
2929# ----------------------------------------------------------#
3030
31- if [ " $service " != " iptables" ] || [ " $service " != " cron" ] || [ " $service " != " mysql" ] || [ " $service " != " hestia" ]; then
32- # Perform a configuration reload so that process is not terminated
33- # resulting in less server downtime.
34- systemctl reload $service > /dev/null 2>&1
35- if [ $? -ne 0 ]; then
36- check_result $E_RESTART " ERROR: Restart of $service failed."
37- log_history " Restart of $service failed."
38- fi
39- else
40- if [ " $service " = " iptables" ]; then
41- # Restart rules for firewall
42- $BIN /v-stop-firewall
43- $BIN /v-update-firewall
44- fi
45- systemctl restart $service > /dev/null 2>&1
31+ Blacklist=(" iptables" ," cron" ," mysql" ," mariadb" ," hestia" )
4632
47- if [ $? -ne 0 ]; then
33+
34+ for BannedService in Blackist; do
35+ if [ " $service " = " $BannedService " ]; then
36+ systemctl restart $service > /dev/null 2>&1
4837 check_result $E_RESTART " ERROR: Restart of $service failed."
4938 log_history " Restart of $service failed."
5039 fi
40+ done
41+
42+ if [ " $service " = " iptables" ]; then
43+ # Restart rules for firewall
44+ $BIN /v-stop-firewall
45+ $BIN /v-update-firewall
5146fi
5247
48+ systemctl reload $service > /dev/null 2>&1
49+ if [ $? -ne 0 ]; then
50+ check_result $E_RESTART " ERROR: Restart of $service failed."
51+ log_history " Restart of $service failed."
52+ fi
53+
54+
5355# ----------------------------------------------------------#
5456# Hestia #
5557# ----------------------------------------------------------#
0 commit comments