summaryrefslogtreecommitdiff
path: root/net/jabber/files/jabberd.sh
blob: c550ee5131399e73f8fa68ead998b4ba50aae395 (plain) (blame)
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
#! /bin/sh

if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jserver\.sh\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1
fi
user=jserver
rundir=/tmp
out=${rundir}/jserver.out

export PATH=/bin:/usr/bin:${PREFIX}/bin
umask 077

test -x ${PREFIX}/bin/jserver || exit 1
echo -n " jserver"
cd ${rundir} || exit

arg=${1:-start}
case $arg in
start)
    su -f -m ${user} -c \
	"jserver" \
	>>${out} 2>&1 &;;

stop)
    killall jserver;;
esac