blob: a60265bfb7afc8ba146e12aafd883164a4f661da (
plain)
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
|
#!/bin/sh
# PROVIDE: matterircd
# REQUIRE: DAEMON NETWORKING
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Options to configure matterircd via /etc/rc.conf:
#
# matterircd_enable (bool) Enable service on boot
# Default: NO
#
# matterircd_conf (str) Config file to use
# Default: ${PREFIX}/etc/matterircd.toml
#
# matterircd_uid (str) User to run matterircd as
# Default: matterircd
#
# matterircd_flags (str) Extra flags passed to matterircd
#
. /etc/rc.subr
name="matterircd"
rcvar="matterircd_enable"
pidfile="/var/run/matterircd.pid"
procname="%%PREFIX%%/bin/matterircd"
load_rc_config $name
: ${matterircd_enable:="NO"}
: ${matterircd_uid:="matterircd"}
: ${matterircd_flags:=""}
: ${matterircd_conf:="%%PREFIX%%/etc/matterircd.toml"}
: ${matterircd_options:="${matterircd_flags} -conf=${matterircd_conf}"}
command="/usr/sbin/daemon"
command_args="-p ${pidfile} -u ${matterircd_uid} -S -T ${name} ${procname} ${matterircd_options}"
run_rc_command "$1"
|