# Check if web server is running
# Customized for Apache2, use "/etc/init.d/apache"
# and "/usr/sbin/httpd -T" otherwise.
if [ $CHECK_WEB = "yes" ] ; then
if /etc/init.d/apache2 status &> /dev/null && wget --delete-after http://www.domain.local/ checkfile.txt &>/dev/null ; then
 	# Web server is running! Try reload, perform syntax check before doing so
	if /usr/sbin/httpd2 -t &>/dev/null; then
		/etc/init.d/apache2 reload &>/dev/null && echo "Web server running and config reload okay."
	else
		echo "### WARNUNG:Reload failed due to CFG error!"
	fi
else
	# Web server not running! Try to launch!
	if /usr/sbin/httpd2 -t &>/dev/null && /etc/init.d /apache2 start &>/dev/null ; then
		echo "### WARNING: Web server was down, restart successful."
	else
		echo "### WARNING: Web server was down, restart FAILED! "
	fi
fi
fi