Merge branch 'master' of https://git.oopen.de/script/monitoring
This commit is contained in:
commit
e815df3653
@ -184,13 +184,22 @@ if $check_apache ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
APACHE_SYSTEMD_SERVICE_EXISTS=false
|
||||||
|
if $systemd_supported ; then
|
||||||
|
if $(locate apache2.service > /dev/null 2>&1) ; then
|
||||||
|
APACHE_SYSTEMD_SERVICE_EXISTS=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
APACHE_INIT_SCRIPT=""
|
APACHE_INIT_SCRIPT=""
|
||||||
if [ -x "/etc/init.d/apache2" ]; then
|
if [ -x "/etc/init.d/apache2" ]; then
|
||||||
APACHE_INIT_SCRIPT="/etc/init.d/apache2"
|
APACHE_INIT_SCRIPT="/etc/init.d/apache2"
|
||||||
elif [ -x "/etc/init.d/apachectl" ]; then
|
elif [ -x "/etc/init.d/apachectl" ]; then
|
||||||
APACHE_INIT_SCRIPT="/etc/init.d/apachectl"
|
APACHE_INIT_SCRIPT="/etc/init.d/apachectl"
|
||||||
else
|
fi
|
||||||
fatal 'Cannot find init-script for Apache web server!'
|
|
||||||
|
if [[ -z "$APACHE_INIT_SCRIPT" ]] && ! $APACHE_SYSTEMD_SERVICE_EXISTS ; then
|
||||||
|
fatal 'Neither an init-script nor a service file for apache2 found!'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -363,7 +372,11 @@ stop_apache() {
|
|||||||
|
|
||||||
## - Stop Apache Webservice
|
## - Stop Apache Webservice
|
||||||
## -
|
## -
|
||||||
|
if $APACHE_SYSTEMD_SERVICE_EXISTS ; then
|
||||||
|
systemctl stop apache2 > /dev/null 2>&1
|
||||||
|
else
|
||||||
$APACHE_INIT_SCRIPT stop > /dev/null 2>&1
|
$APACHE_INIT_SCRIPT stop > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
sleep 12
|
sleep 12
|
||||||
|
|
||||||
@ -691,7 +704,14 @@ start_apache() {
|
|||||||
send_msg=$1
|
send_msg=$1
|
||||||
send_msg=${send_msg:=true}
|
send_msg=${send_msg:=true}
|
||||||
|
|
||||||
|
|
||||||
|
## - Start Apache Webservice
|
||||||
|
## -
|
||||||
|
if $APACHE_SYSTEMD_SERVICE_EXISTS ; then
|
||||||
|
systemctl start apache2 > /dev/null 2>&1
|
||||||
|
else
|
||||||
$APACHE_INIT_SCRIPT start > /dev/null 2>&1
|
$APACHE_INIT_SCRIPT start > /dev/null 2>&1
|
||||||
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
NEWPID=$(ps aux | grep "$HTTPD" | grep -v grep | grep root | awk '{print$2}')
|
NEWPID=$(ps aux | grep "$HTTPD" | grep -v grep | grep root | awk '{print$2}')
|
||||||
|
Loading…
Reference in New Issue
Block a user