aboutsummaryrefslogtreecommitdiff
path: root/www/ot-recorder/files/ot-recorder.in
blob: 87f2385e84bc036a6f978bba39d2128f6017f556 (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
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: otrecorder
# REQUIRE: LOGIN mosquitto hass
# KEYWORD: shutdown
#
#
# Add the following lines to /etc/rc.conf to configure ot-recorder:
# otrecorder_enable (bool):     Set it to "YES" to enable ot-recorder.
#                               Default is "NO".
# otrecorder_args (str):        Arguments passed to ot-recorder on startup.
#                               Default is "".

. /etc/rc.subr

name=otrecorder
rcvar=${name}_enable
pidfile="/var/run/otrecorder/${name}.pid"
otrecorder_command="stdbuf -o0 %%PREFIX%%/sbin/ot-recorder"
command="/usr/sbin/daemon"

load_rc_config $name
: ${otrecorder_enable:=NO}
: ${otrecorder_args:=""}
: ${otrecorder_user:="ot-recorder"}

command_args="-P ${pidfile} -r -f -o /var/log/ot-recorder/ot-recorder.log ${otrecorder_command} ${otrecorder_args}"

run_rc_command "$1"