#!/bin/sh -e
# Permission processing inserted by debmake on Sat, 29 Aug 1998 22:53:01 +0000

echo
if [ -f /etc/aegis.conf ]
then
	echo "An aegis configuration already exists. Use it [Y/n]"
	read resp;
	case "$resp" in
	[Nn]*)
		echo
		echo "Reconfiguring Aegis"
		;;
	*)
		source /etc/aegis.conf
		resp=$ALLOW_WWW_ACCESS
		echo -n "Leaving the web-interface "
		case "$resp" in
		[Nn]*) 
			echo "disabled"
			;;
		*)
			echo "enabled"
		esac
		exit 0
	esac	
fi

echo "Aegis includes cgi-scripts that allow read-only access" 
echo "of the source repository using a web-browser."
echo ""
echo -n "Would you like to enable the web-interface <Y/n> "
read resp;

echo

case "$resp" in
[Nn]*) 
	echo "Disabling the web-interface"
	;;
*)
	echo "Enabling the web-interface"
esac
echo "# Aegis Configuration" `date` >/etc/aegis.conf
echo "# Produced by /usr/sbin/aegisconfig" >>/etc/aegis.conf
echo "#" >>/etc/aegis.conf
echo "# Set ALLOW_WWW_ACCESS to a Y or a N to allow or dissalow" >>/etc/aegis.conf
echo "#  web access to the repository" >>/etc/aegis.conf
echo "ALLOW_WWW_ACCESS="$resp >>/etc/aegis.conf
echo >>/etc/aegis.conf


