-
-# Restart Apache2 web server if needed.
-#
-if [ $need_restart -eq 1 ]; then
-
- # Check Apache2 web server configuration.
- if /usr/sbin/apache2ctl configtest 2>/dev/null; then
-
- # Restart Apache2 web server.
- if [ -x "/etc/init.d/apache2" ]; then
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d apache2 restart || true
- else
- /etc/init.d/apache2 restart || true
- fi
- fi
- else
-
- # Something is broken.
- cp_echo "CN: Your Apache2 configuration is broken."
- cp_echo "CN: Please, check the service after the installation finishes!"
- fi
+if ! apache2ctl configtest >/dev/null 2>&1; then
+ cp_echo "CN: Your Apache2 configuration seems to be broken."
+ cp_echo "CN: Please, check the service after the installation finishes!"