#!/bin/bash

. ${TOOLKIT}-functions.sh

# GLPI

module="glpi"

# crea ed inserisce lista Allow in snippet config file di apache2
#
files="
	ku-glpi.conf
	ku-ocsng-comm.conf
	ku-ocsng-manage.conf
"

for file in $files
do
	file=`filepath $file` || exit 1
	out=`basename $file`
	module=`echo "$out" | sed -e 's/ku-//' -e 's/-.*//' -e 's/\.conf//'`
	allowed=`jtconf $module.allow` || exit_missing_define "$module.allow"

	string=
	for allow in $allowed
	do
		string="$string	Allow from $allow\n"
	done

	sed -e "s#-ku-temp-tag-for-inserting-allow-ku-#$string#" $file > $out.tmp
done

exit 0
