#!/usr/local/bin/bash

# 
#
# Copyright (C) 2004 SIPfoundry Inc.
# Licensed by SIPfoundry under the LGPL license.
#
# Copyright (C) 2004 Pingtel Corp.
# Licensed to SIPfoundry under a Contributor Agreement.
#
# $$
##############################################################################

CONFIG_DEFS="/usr/local/etc/sipxpbx/config.defs"

# If the "config.defs" file exists and the <name>.in file exists for a
# configuration file, then run the config preprocessor to generate the
# fully resolved configuration file.
if [ -f "$CONFIG_DEFS" ]
then
  for cfgfile in /usr/local/etc/sipxpbx/http*.in
  do
    if [ -f ${cfgfile} ]
    then
       genfile=`basename ${cfgfile} .in`
       gendir=`dirname ${cfgfile}`
       /usr/local/bin/configpp --defs "${CONFIG_DEFS}" --in "${cfgfile}" --out "${gendir}/${genfile}"
    fi
  done
fi
