File: gen-yaws-conf

package info (click to toggle)
yaws 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,012 kB
  • sloc: erlang: 42,153; sh: 2,501; javascript: 1,459; makefile: 968; ansic: 890; lisp: 79; python: 34; xml: 12; php: 1
file content (27 lines) | stat: -rwxr-xr-x 705 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

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

set -e

if [ ! -n "$PORT" ]; then
    echo 'error: PORT environment variable must be set' >&2
    exit 1
fi
if [ ! -n "$SSLPORT" ]; then
    echo 'error: SSLPORT environment variable must be set' >&2
    exit 1
fi

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