From d732f500bc6bf2150c23fd3389df07f3b65144ff Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Aug 2017 13:31:18 +0000 Subject: [PATCH] Add systemctl command to check for apache service --- Modular Scripts/Apache2/configure-apache.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modular Scripts/Apache2/configure-apache.sh b/Modular Scripts/Apache2/configure-apache.sh index 48f30c9..48dc167 100644 --- a/Modular Scripts/Apache2/configure-apache.sh +++ b/Modular Scripts/Apache2/configure-apache.sh @@ -113,7 +113,11 @@ checkApacheDetails() getApacheServiceName #verify if apache is installed as service - if [ ! -f /etc/init.d/$SERVICE ]; then + if [ -f /etc/init.d/$SERVICE ]; then + logMsgToConfigSysLog "INFO" "INFO: Apache is present as a service." + elif [[ $(which systemctl) && $(systemctl list-unit-files $SERVICE.service | grep "$SERVICE.service") ]] &>/dev/null; then + logMsgToConfigSysLog "INFO" "INFO: Apache is present as a service." + else logMsgToConfigSysLog "ERROR" "ERROR: Apache is not configured as a service" exit 1 fi