#!/bin/bash

. ${TOOLKIT}-functions.sh

update_trac_istances()
{
	local prj=
	local prjname=

	for prj in `jtconf --list trac. 2>/dev/null`
	do
		prjname=`echo $prj | sed -e 's/^trac\.//'`
		ku-trac-project $prjname	# ignore errors
	done
	ku-trac-update --verbose		# ignore errors
	return 0
}

# modules need by LDAP authentication
#
apache2_enable_module ldap
apache2_enable_module authnz_ldap

apache2_enable_site ku-site-trac

$SOMETHING_CHANGED && {
	update_trac_istances
	reload_service apache2 apache2 || exit $?
}

exit 0
