freebsd-ports/www/www6to4/files/www6to4.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

37 lines
800 B
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: www6to4
# REQUIRE: DAEMON
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# www6to4_enable="YES"
#
. /etc/rc.subr
name=www6to4
rcvar=www6to4_enable
command=%%PREFIX%%/sbin/www6to4
WWW6TO4DIR=%%PREFIX%%/etc/www6to4
www6to4_enable=${www6to4_enable:-"NO"}
www6to4_config=${www6to4_config:-"${WWW6TO4DIR}/www6to4.conf"}
www6to4_flags=${www6to4_flags:-"-c ${www6to4_config}"}
www6to4_user=${www6to4_user:-"nobody"}
www6to4_chdir=${WWW6TO4DIR}
required_files=${www6to4_config}
required_dirs=${WWW6TO4DIR}
start_cmd=www6to4_start
www6to4_start() {
checkyesno www6to4_enable && echo "Starting ${name}." && \
chdir ${www6to4_chdir} && su -m ${www6to4_user} -c "$command ${www6to4_flags} &"
}
load_rc_config ${name}
run_rc_command "$1"