#!/bin/sh
SRS_FORWARD_PORT=10001
SRS_REVERSE_PORT=10002
SRS_DOMAIN="`postconf -h mydomain || true`"
SRS_SECRET="@SYSCONF_DIR@/@PROJECT_NAME@.secret"
SRS_SEPARATOR="="
SRS_HASHLENGTH=4
SRS_HASHMIN=4
SRS_EXTRA_OPTIONS=
RUN_AS=nobody
SRS_LISTEN_ADDR=127.0.0.1
CHROOT="@CHROOT_DIR@"
SRS_EXCLUDE_DOMAINS=
# Read config file if it is present
if [ -r "@CONFIG_DIR@/@PROJECT_NAME@" ]
then
	. "@CONFIG_DIR@/@PROJECT_NAME@"
fi
exec @CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ ${SRS_EXTRA_OPTIONS} -f "${SRS_FORWARD_PORT}" -r "${SRS_REVERSE_PORT}" -d "${SRS_DOMAIN}" -s "${SRS_SECRET}" -a "${SRS_SEPARATOR}" -n "${SRS_HASHLENGTH}" -N "${SRS_HASHMIN}" -u "${RUN_AS}" -l "${SRS_LISTEN_ADDR}" -c "${CHROOT}" "-X${SRS_EXCLUDE_DOMAINS}"
