aboutsummaryrefslogtreecommitdiff
path: root/www/tclhttpd/files/tclhttpd.in
blob: c63303ba6b034c98b6796912cedfbf7077460a9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/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"