File: yaws.sh

package info (click to toggle)
yaws 1.65-4etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,164 kB
  • ctags: 3,907
  • sloc: erlang: 20,138; sh: 3,675; makefile: 556; ansic: 404; lisp: 79
file content (56 lines) | stat: -rw-r--r-- 825 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
#

#
# PROVIDE: yaws
# REQUIRE: DAEMON
#
# You will need to set some variables in /etc/rc.conf to start Yaws:
#
# yaws=YES
# yaws_flags=""
# yaws_id=""
#

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="yaws"
rcvar=$name
yaws_command="%prefix%bin/${name}"
required_files="%etcdir%yaws.conf"

start_cmd="yaws_start"
stop_cmd="yaws_stop"
status_cmd="yaws_status"
reload_cmd="yaws_reload"
extra_commands="reload status"

: ${yaws_id:=default}
: ${yaws_flags:=--heart}

yaws_start() {
	$yaws_command --id $yaws_id $yaws_flags --daemon
}

yaws_stop() {
	$yaws_command --id $yaws_id --stop 
}

yaws_status() {
	$yaws_command --id $yaws_id --status
}

yaws_reload() {
	$yaws_command --id $yaws_id --hup
}

if [ -f /etc/rc.subr -a -f /etc/rc.conf ]
then
	load_rc_config $name
	run_rc_command "$1"
else
	yaws_start
fi