diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2005-12-09 14:49:43 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2005-12-09 14:49:43 +0000 |
commit | da4839ee4b10fdc9deae71b6ea3a6c5290c1f4d3 (patch) | |
tree | a932e2cfb5e8272dfb3426572c781e49ea5ab23b /net/cvsup-mirror/files/cvsupd.sh.in | |
parent | - Reset longtime inactive maintainer (diff) |
- Provide rcNG startup script
PR: ports/89316
Submitted by: Petr Rehor <prehor@gmail.com>
Approved by: maintainer timeout (jpd; 19 days)
Diffstat (limited to 'net/cvsup-mirror/files/cvsupd.sh.in')
-rw-r--r-- | net/cvsup-mirror/files/cvsupd.sh.in | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/net/cvsup-mirror/files/cvsupd.sh.in b/net/cvsup-mirror/files/cvsupd.sh.in new file mode 100644 index 000000000000..78a666879bf7 --- /dev/null +++ b/net/cvsup-mirror/files/cvsupd.sh.in @@ -0,0 +1,50 @@ +#! /bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: cvsupd +# REQUIRE: DAEMON +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable cvsupd: +# +#cvsupd_enable="YES" + +. %%RC_SUBR%% + +name="cvsupd" +rcvar=`set_rcvar` + +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}} + +command="%%PREFIX%%/sbin/cvsupd" +command_args="-e -C ${maxclients:-8} -l @${facility:-daemon} \ + -b ${base:-/home/ncvs} -s sup.client" +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" |