summaryrefslogtreecommitdiff
path: root/net-im/ejabberd/files/ejabberd.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/ejabberd/files/ejabberd.in')
-rw-r--r--net-im/ejabberd/files/ejabberd.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/net-im/ejabberd/files/ejabberd.in b/net-im/ejabberd/files/ejabberd.in
new file mode 100644
index 000000000000..f97ec26fb215
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd.in
@@ -0,0 +1,35 @@
+#!/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}\" \
+ $ERL_OPTIONS $ARGS "$@"
+