#!/bin/sh
#

# Copy default files if necessary and configure
if ! test -f "/var/www/Sherpath/config/setup/general.config.php3"; then
	if test -f "/var/www/Sherpath/config/setup/general.config.php3.orig"; then
		cp -ax "/var/www/Sherpath/config/setup/general.config.php3.orig" "/var/www/Sherpath/config/setup/general.config.php3"
	fi
	if ! test -f "/var/www/Sherpath/config/setup/pregeneral.config.php3"; then
		cp -ax "/var/www/Sherpath/config/setup/pregeneral.config.php3.orig" "/var/www/Sherpath/config/setup/pregeneral.config.php3"
	fi
	echo
	printf "configure (y/N) ?"
	read OK
	if ! test -n "$OK"; then
        	OK="n"
	fi
	if test "$OK" = "y"; then
		# run config script
		cd /var/www/Sherpath
		/var/www/Sherpath/install.sh
	fi

fi

echo "Sherpath successfuly installed"
echo "go now to http://<yourwebserver_location>/Sherpath/ or http://<yoursherpath_location>/"
echo

exit 0
