freebsd-ports/net/cvsup-mirror/files/cvsupd.sh
John Polstra d173bd5e46 When sourcing "config.sh" in shell scripts, specify it as "./config.sh"
to prevent the shell from searching the PATH for the file.

Submitted by:	David Quattlebaum <sasdrq@unx.sas.com>
1998-02-12 01:14:02 +00:00

18 lines
418 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
out=/var/tmp/cvsupd.out
export PATH=/bin:/usr/bin:${PREFIX}/sbin
umask 2
test -x ${PREFIX}/sbin/cvsupd || exit 1
echo -n " cvsupd"
cd ${base} || exit
. ./config.sh || exit
su -m ${user} -c \
"cvsupd -e -C ${maxclients} -l @${facility}" >>${out} 2>&1