freebsd-ports/net/cvsup-mirror/files/cvsupd.sh
John Polstra d6a2c9b4cb Put core dumps and crash output (cvsupd.out) into /var/run instead
of /var/tmp.  Create cvsupd.out with mode 644 if it doesn't already
exist.  Bump PORTREVISION.

Suggested by:	Joshua Goodall <joshua@roughtrade.net>
2002-11-11 17:21:29 +00:00

29 lines
576 B
Bash

#! /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/run
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)
(umask 22 && touch ${out}) || exit
su -f -m ${user} -c \
"cvsupd -e -C 100 -l @${facility} -b ${base} -s sup.client" \
>>${out} 2>&1;;
stop)
killall cvsupd;;
esac