6eceb3c9e1
ejabberd is a free and open source instant messaging server written in Erlang. ejabberd is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication (Jabber/XMPP). submitted by viq <viq at viq.ath.cx> a long time ago, with tweaks by various people on ports@, martynas@ and me ok martynas@
28 lines
707 B
Bash
Executable File
28 lines
707 B
Bash
Executable File
#!/bin/sh
|
|
PREFIX="!!LOCALBASE!!"
|
|
EJLIBDIR="${PREFIX}/lib/ejabberd"
|
|
ID=`id -g`
|
|
EJID=`id -g !!JABBERDUSER!!`
|
|
export HOME="!!EJDBDIR!!"
|
|
|
|
if [ "$ID" -ne 0 -a "$ID" -ne "$EJID" ]; then
|
|
echo "this command can only be run by root and the _ejabberd user" >&2
|
|
exit 1
|
|
fi
|
|
if [ X"$1" == "X" ]; then
|
|
echo "not enough arguments" >&2
|
|
exit 2
|
|
fi
|
|
echo "$1" | grep -q "@"
|
|
if [ $? -ne 0 ]; then
|
|
nodename="ejabberd@`hostname -s`"
|
|
else
|
|
nodename=""
|
|
fi
|
|
|
|
if [ $ID -eq 0 ]; then
|
|
exec su -l !!JABBERDUSER!! ${PREFIX}/bin/erl -noinput -pa ${EJLIBDIR}/ebin -sname ejabberdctl -s ejabberd_ctl -extra $nodename $@
|
|
else
|
|
exec ${PREFIX}/bin/erl -noinput -pa ${EJLIBDIR}/ebin -sname ejabberdctl -s ejabberd_ctl -extra $nodename $@
|
|
fi
|