# ToughLog install_var.sh
# $Id$

if [ -z "${INSTALL_VAR}" ]; then
	INSTALL_VAR=1

	APACHELOGS=/var/log/httpd
	APACHEUSER=apache
	APACHEGROUP=apache

	PGDATABASE=toughlog
	PGUSER=toughlog
	PGPORT=5432
	PGHOST=localhost

	# Location of plpgsql.so
	#PLPGSQL=/usr/lib/plpgsql.so

	# -------------------------------------------------------------------

	APACHECONFS="/etc/httpd/conf/httpd.conf /etc/apache2/conf/apache2.conf /etc/apache/conf/apache.conf /etc/apache2/apache2.conf"
	for APACHECONF in ${APACHECONFS}; do
		if [ -e ${APACHECONF} ]; then
			echo "Apache conf found in: ${APACHECONF}"
			break
		fi
	done

	if [ ! -e "${APACHECONF}" ]; then
		echo "Error, Apache conf not found: ${APACHECONFS}"
		echo "Correct 'install_var.sh' and start installation again."
		exit 1
	fi

	APACHELOGS="/var/log/httpd /var/log/apache /var/log/apache2"
	for APACHELOG in ${APACHELOGS}; do
		if [ -d ${APACHELOG} ]; then
			echo "Apache log found in: ${APACHELOG}"
			break
		fi
	done

	if [ ! -d "${APACHELOG}" ]; then
		echo "Error, Apache log not found: ${APACHELOGS}"
		echo "Correct 'install_var.sh' and start installation again."
		exit 1
	fi

fi # if [ -z "${INSTALL_VAR}" ]

