summaryrefslogtreecommitdiff
path: root/net/librespeed-go/files/librespeed-go.in
blob: 8a9959ed1220c211aeb90c8223fb4fb0ede45504 (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: %%PORTNAME%%
# REQUIRE: SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# librespeed_go_enable:		Set to NO by default.
#				Set it to YES to enable librespeed-go
# librespeed_go_pid:		Path of the pid file.
#				Default /var/run/%%PORTNAME%%/%%PORTNAME%%.pid
# librespeed_go_user:		The user account used to run the daemon.
#				Default: %%LIBRESPEED_USER%%
# librespeed_go_group:		The group used to run the daemon.
#				Default: %%LIBRESPEED_GROUP%%
# librespeed_go_daemonflags:	Flags passed to daemon(8)
#				Default -f which prevents any logging

. /etc/rc.subr

name="librespeed_go"
rcvar="${name}_enable"
command="/usr/sbin/daemon"

load_rc_config $name

: ${librespeed_go_enable:="NO"}
: ${librespeed_go_pid:="/var/run/%%PORTNAME%%/%%PORTNAME%%.pid"}
: ${librespeed_go_user:="%%LIBRESPEED_USER%%"}
: ${librespeed_go_group:="%%LIBRESPEED_GROUP%%"}
: ${librespeed_go_daemonflags:="-f"}

pidfile="$librespeed_go_pid"
procname="%%PREFIX%%/bin/%%PORTNAME%%"
command_args="$librespeed_go_daemonflags -p $pidfile $procname"

run_rc_command "$1"