1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00
freebsd-ports/net/cvsup-mirror/files/cvsupd.in
Doug Barton 9aac569eaa Move the rc.d scripts of the form *.sh.in to *.in
Where necessary add $FreeBSD$ to the file

No PORTREVISION bump necessary because this is a no-op
2012-08-05 23:19:36 +00:00

66 lines
1.4 KiB
Bash

#! /bin/sh
#
# $FreeBSD$
#
# PROVIDE: cvsupd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable cvsupd:
#
#cvsupd_enable="YES"
#
# Flag settings are now able to be overridden in /etc/rc.conf. The order
# of priority is:
#
# Settings found in /etc/rc.conf are used (cvsupd_flags)
# If nothing is found in /etc/rc.conf then settings found in
# %%PREFIX%%/etc/cvsup/config.sh are used.
# If nothing is found in %%PREFIX%%/etc/cvsup/config.sh
# then the hardcoded values below are used.
#
#cvsupd_flags="-e -C 8 -l @daemon -b /home/ncvs -s sup.client"
#
# Note that answering the questions during the install will setup
# %%PREFIX%%/etc/cvsup/config.sh for you.
. /etc/rc.subr
name="cvsupd"
rcvar=cvsupd_enable
load_rc_config $name
# Load defaults from cvsupd config file
base="%%PREFIX%%/etc/cvsup"
if [ ! -r "${base}/config.sh" ]; then
err 1 "${base}/config.sh is not readable."
fi
. ${base}/config.sh
# Set defaults
: ${cvsupd_enable:=NO}
: ${cvsupd_outfile=/var/run/${name}.out}
: ${cvsupd_user:=${user:-cvsup}}
: ${cvsupd_flags:="-e -C ${maxclients:-8} -l @${facility:-daemon} \
-b ${base:-/home/ncvs} -s sup.client"}
command="%%PREFIX%%/sbin/cvsupd"
stop_cmd="cvsupd_stop"
cvsupd_stop() {
if [ -z "$rc_pid" ]; then
echo "${name} not running?"
exit 1
fi
echo "Stopping ${name}."
killall $name
_return=$?
[ "$_return" -ne 0 ] && [ -z "$rc_force" ] && return 1
}
run_rc_command "$1"