|
|
@@ -23,32 +23,17 @@ PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
check_args '1' "$#" 'SERVICE'
|
|
|
-service_status=$(pgrep $service)
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
# Action #
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
-if [ -z "$service_status" ]; then
|
|
|
- force="yes"
|
|
|
-fi
|
|
|
-
|
|
|
if [ "$service" = "iptables" ]; then
|
|
|
# Run the restart rules for iptables firewall
|
|
|
$BIN/v-stop-firewall
|
|
|
$BIN/v-update-firewall
|
|
|
-elif [ -z "$force" -o "$force" = "no" ] && [ \
|
|
|
- "$service" = "nginx" -o \
|
|
|
- "$service" = "apache2" -o \
|
|
|
- "$service" = "exim4" -o \
|
|
|
- "$service" = "dovecot" -o \
|
|
|
- "$service" = "bind9" -o \
|
|
|
- "$service" = "named" -o \
|
|
|
- "$service" = "vsftpd" -o \
|
|
|
- "$service" = "proftpd" -o \
|
|
|
- "$service" = "ssh" -o \
|
|
|
- "$service" = "fail2ban" ]; then
|
|
|
- systemctl reload $service > /dev/null 2>&1
|
|
|
+elif [ -z "$force" -o "$force" = "no" ]; then
|
|
|
+ systemctl reload-or-restart $service > /dev/null 2>&1
|
|
|
else
|
|
|
systemctl restart $service > /dev/null 2>&1
|
|
|
fi
|