|
|
@@ -11,7 +11,7 @@
|
|
|
|
|
|
# Argument definition
|
|
|
service=$1
|
|
|
-force=$2
|
|
|
+restart=$2
|
|
|
|
|
|
# Includes
|
|
|
source $HESTIA/func/main.sh
|
|
|
@@ -23,6 +23,7 @@ PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
check_args '1' "$#" 'SERVICE'
|
|
|
+is_format_valid 'service' 'restart'
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
# Action #
|
|
|
@@ -32,7 +33,7 @@ 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" ] && [ \
|
|
|
+elif [ -z "$restart" -o "$restart" = "no" ] && [ \
|
|
|
"$service" = "nginx" -o \
|
|
|
"$service" = "apache2" -o \
|
|
|
"$service" = "exim4" -o \
|
|
|
@@ -64,4 +65,7 @@ if [ $? -ne 0 ]; then
|
|
|
log_history "Restart of $service failed."
|
|
|
fi
|
|
|
|
|
|
+# Logging
|
|
|
+log_event "$OK" "$ARGUMENTS"
|
|
|
+
|
|
|
exit
|