#!/bin/sh

# Used by scripts/Makefile and scripts/rebar-pre-script to create
# the yaws.conf file

set -e

cat yaws.conf.template                  | \
    ./Subst %yawsdir% "$YAWSDIR"        | \
    ./Subst %logdir%  "$LOGDIR"         | \
    ./Subst %vardir%  "$VARDIR"         | \
    ./Subst %port%    $PORT             | \
    ./Subst %docroot% "$DOCROOT"        | \
    ./Subst %tmpdir%  "${TMPDIR:-/tmp}" | \
    ./Subst %certdir% "$CERTDIR"        | \
    ./Subst %sslport% $SSLPORT

exit 0
