freebsd-ports/www/tclhttpd/files/tclhttpd.sh.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

41 lines
1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: tclhttpd
# REQUIRE: NETWORKING SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable tclhttpd:
#
# tclhttpd_enable (bool): Set it to "YES" to enable tclhttpd
# Default is "NO".
#
# tclhttpd_flags (str): Arguments to be passed to tclhttpd.
# Default is "".
#
# tclhttpd_stdout_log(str): Set to the location for the tclhttpd
# process log (standard out)
#
# tclhttpd_stderr_log (str): Set to the location for the tclhttpd
# process log (standard error)
. /etc/rc.subr
name="tclhttpd"
rcvar=tclhttpd_enable
load_rc_config $name
: ${tclhttpd_enable="NO"}
: ${tclhttpd_stdout_log="/var/log/tclhttpd-stdout.log"}
: ${tclhttpd_stderr_log="/var/log/tclhttpd-stderr.log"}
procname="%%LOCALBASE%%/bin/tclsh%%TCL_DVER%%"
pidfile=/var/run/tclhttpd.pid
log_args=">> ${tclhttpd_stdout_log} \
2>> ${tclhttpd_stderr_log} "
command="/usr/sbin/daemon"
flags="-p ${pidfile} %%LOCALBASE%%/bin/tclsh%%TCL_DVER%% %%PREFIX%%/bin/httpd.tcl ${tclhttpd_flags} ${log_args}"
run_rc_command "$1"