This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
larpe/fedora/larpe-reload-apache2-script

23 lines
461 B
Bash
Executable File

#!/bin/sh
#
# The command "/etc/init.d/httpd reload" on Fedora actually _restarts_ Apache
# We need to _reload_ it without closing existing connections
APACHE2CTL=/usr/sbin/apachectl
echo -n "Testing Apache config... "
if ! $APACHE2CTL configtest > /dev/null 2>&1; then
$APACHE2CTL configtest || true
echo "[FAILED]"
exit 1
else
echo "[OK]"
fi
echo -n "Reloading Apache config... "
if $APACHE2CTL graceful $2 ; then
echo "[OK]"
else
echo "[FAILED]"
fi