#!/bin/sh
#----------------------------------------------------------------------------
# /var/install/bin/pre-setup-services-apache2-config-modules-trac-web-auth
#
# Creation: 2020-01-16 hb
# Last Update: $Id$
#
# Copyright (c) 2020-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------
# include config
. /etc/config.d/trac
# exec 2>/tmp/$(basename ${0})-trace$$.log
# set -x
# ---------------------------------------------------------------------------
# create menu
# ---------------------------------------------------------------------------
create_menu()
{
{
echo "
Trac Web Auth Administration"
echo "trac"
echo ""
echo ""
web_name=''
ac_all=''
idx=1
while [ ${idx} -le ${TRAC_PROJ_GRP_N:-0} ]
do
project_name='TRAC_PROJ_GRP'
eval active='${TRAC_PROJ_GRP_'${idx}'_ACTIVE}'
if [ "${active}" != "yes" ]
then
idx=$((${idx} + 1))
continue
fi
eval web_name='${TRAC_PROJ_GRP_'${idx}'_NAME}'
echo ""
idx=$((${idx} + 1))
done
web_name=''
ac_all=''
idx=1
while [ ${idx} -le ${TRAC_PROJ_N:-0} ]
do
project_name='TRAC_PROJ'
eval active='${TRAC_PROJ_'${idx}'_ACTIVE}'
if [ "${active}" != "yes" ]
then
idx=$((${idx} + 1))
continue
fi
eval web_name='${TRAC_PROJ_'${idx}'_NAME}'
echo ""
idx=$((${idx} + 1))
done
} > "${menu_file}"
chmod 0640 ${menu_file}
}
# ---------------------------------------------------------------------------
# main
# ---------------------------------------------------------------------------
main()
{
package_name="${2}"
menu_file="${4}"
create_menu
}
# ---------------------------------------------------------------------------
# call function main
# ---------------------------------------------------------------------------
main "${@}"
# ---------------------------------------------------------------------------
# end
# ---------------------------------------------------------------------------