freebsd-ports/net-im/jabberd/files/jabberd.sh
Dmitry Sivachenko b635444c7d Eliminate the evidence that I stole this file from net/jabber port.
Update to reflect the actual names of spawned processes and
.pid-files location.
2004-01-01 13:19:25 +00:00

37 lines
697 B
Bash

#! /bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jabberd\.sh\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
USER="jabber"
RUNDIR="/var/jabberd/pid"
HOSTNAME=`/bin/hostname`
test -x ${PREFIX}/bin/jabberd || exit 1
export PATH=/sbin:/bin:/usr/bin:${PREFIX}/bin:${PREFIX}/sbin
umask 077
cd ${RUNDIR} || exit
case "$1" in
start)
su -f -m ${USER} -c ${PREFIX}/bin/jabberd &
echo -n ' jabberd'
;;
stop)
killall -u ${USER} jabberd c2s resolver router s2s sm
for file in c2s resolver router s2s sm
do
rm -f ${RUNDIR}/$file.pid
done
echo -n ' jabberd'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0