From 0154e78671f3dce9c50d776a2533c04f050955d0 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 1 Aug 2018 11:42:57 +0200 Subject: [PATCH] Fix bug in determin 'APACHE_SERVICE_FILE'. --- check_webservice_load.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/check_webservice_load.sh b/check_webservice_load.sh index ec663cb..33699db 100755 --- a/check_webservice_load.sh +++ b/check_webservice_load.sh @@ -293,12 +293,20 @@ if $check_apache ; then # - Is Service exclusive controlled by systemd # - if systemctl -t service list-unit-files \ + | grep -e "^apache2.service" \ + | grep -q -E "(enabled|disabled)" 2> /devnull ; then + + APACHE_SERVICE_FILE="apache2.service" + + elif systemctl -t service list-unit-files \ | grep -e "^apache" \ | grep -q -E "(enabled|disabled)" 2> /devnull ; then + APACHE_SERVICE_FILE=$(systemctl -t service list-unit-files \ | grep -e "^apache" \ - | awk '{print$1}') + | awk '{print$1}' \ + | head -1) fi fi @@ -316,6 +324,7 @@ if $check_apache ; then fi fi + if $check_nginx ; then NGINXD="$(realpath $(which nginx))"