summaryrefslogtreecommitdiff
path: root/net/cvsup-mirror/files/cvsupd.sh
blob: f470dd3c60700977156495e7860c6d6e0d0355ba (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
28
#! /bin/sh

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

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

test -x ${PREFIX}/sbin/cvsupd || exit 1
echo -n " cvsupd"
cd ${rundir} || exit
. ${base}/config.sh || exit

arg=${1:-start}
case $arg in
start)
    su -f -m ${user} -c \
	"cvsupd -e -C 100 -l @${facility} -b ${base} -s sup.client" \
	>>${out} 2>&1;;

stop)
    killall cvsupd;;
esac