summaryrefslogtreecommitdiff
blob: 6443678cf9b27a187a19641c5ec2d1ca0b93d0f0 (plain)
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
28
29
30
#!/bin/sh

[ -f /etc/conf.d/ejabberd ] && . /etc/conf.d/ejabberd

if [ -r /var/run/jabber/.erlang.cookie ] ; then
    HOME=/var/run/jabber
    export HOME
fi

ERL=/usr/bin/erl

if [ $# -ne 0 ] ; then
    case $1 in
	--node) shift ; EJABBERD_NODE=$1 ; shift ;;
    esac
fi

if [ "$EJABBERD_NODE" = "${EJABBERD_NODE%.*}" ] ; then
    SNAME=-sname
else
    SNAME=-name
fi

exec $ERL $SNAME ejabberdctl \
    -pa /usr/@libdir@/erlang/lib/ejabberd-@version@/ebin \
    -s ejabberd_ctl \
    -noinput \
    -extra $EJABBERD_NODE "$@"