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))"