freebsd-ports/net-im/ejabberd/files/ejabberd.in
Renato Botelho 0e8c34c0e9 - Update to 1.1.1 (fixes a security issue)
- Ensure ejabberd can find its files

PR:		ports/96675
Poked by:	Denis Shaposhnikov
Submitted by:	maintainer
2006-05-08 12:37:38 +00:00

36 lines
911 B
Bash

#!/bin/sh
[ -f %%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.defaults ] && . %%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.defaults
CONFIG=%%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.cfg
INETRC=%%PREFIX%%/etc/%%PORTNAME%%/%%PORTNAME%%.inetrc
LOG=/var/log/%%PORTNAME%%/%%PORTNAME%%.log
SASL_LOG=/var/log/%%PORTNAME%%/sasl.log
SPOOL=/var/spool/%%PORTNAME%%
ARGS=
while [ $# -ne 0 ]
do
PARAM=$1
shift
case $PARAM in
--) break ;;
--config) CONFIG=$1 ; shift ;;
--log) LOG=$1 ; shift ;;
--sasl-log) SASL_LOG=$1 ; shift ;;
--spool) SPOOL=$1 ; shift ;;
*) ARGS="$ARGS $PARAM" ;;
esac
done
cd $SPOOL &&
exec erl +K true -sname %%PORTNAME%% \
-s %%PORTNAME%% \
-%%PORTNAME%% config \"$CONFIG\" log_path \"$LOG\" \
-sasl sasl_error_logger \{file,\"$SASL_LOG\"\} \
-mnesia dir \"$SPOOL\" \
-kernel inetrc \"${INETRC}\" \
-pz "%%LOCALBASE%%/lib/erlang/" \
$ERL_OPTIONS $ARGS "$@"