#!/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 %host% `hostname` | \
    ./Subst %port% $PORT | \
    ./Subst %docroot% "$DOCROOT" | \
    ./Subst %certdir% "$CERTDIR" | \
    ./Subst %sslport% $SSLPORT

exit 0
