Lines 11-24
Link Here
|
11 |
# cloudflared_conf (str) Config file to use |
11 |
# cloudflared_conf (str) Config file to use |
12 |
# Default: %%ETCDIR%%/config.yml |
12 |
# Default: %%ETCDIR%%/config.yml |
13 |
# |
13 |
# |
14 |
# cloudflared_mode (str) Mode to run cloudflared as (tunnel, or proxy-dns) |
14 |
# cloudflared_mode (str) Mode to run cloudflared as (e.g. 'tunnel run' or 'proxy-dns') |
15 |
# Default: tunnel |
15 |
# Default: 'tunnel run' |
16 |
|
16 |
|
17 |
. /etc/rc.subr |
17 |
. /etc/rc.subr |
18 |
|
18 |
|
19 |
name="cloudflared" |
19 |
name="cloudflared" |
20 |
rcvar="cloudflared_enable" |
20 |
rcvar="cloudflared_enable" |
21 |
logfile="/var/log/cloudflared/cloudflared.log" |
21 |
logfile="/var/log/cloudflared.log" |
22 |
pidfile="/var/run/cloudflared.pid" |
22 |
pidfile="/var/run/cloudflared.pid" |
23 |
procname="%%PREFIX%%/bin/cloudflared" |
23 |
procname="%%PREFIX%%/bin/cloudflared" |
24 |
|
24 |
|
Lines 26-34
load_rc_config $name
Link Here
|
26 |
|
26 |
|
27 |
: ${cloudflared_enable:="NO"} |
27 |
: ${cloudflared_enable:="NO"} |
28 |
: ${cloudflared_conf:="%%ETCDIR%%/config.yml"} |
28 |
: ${cloudflared_conf:="%%ETCDIR%%/config.yml"} |
29 |
: ${cloudflared_mode:="tunnel"} |
29 |
: ${cloudflared_mode:="tunnel run"} |
30 |
|
30 |
|
31 |
command="/usr/sbin/daemon" |
31 |
command="/usr/sbin/daemon" |
32 |
command_args="-o ${logfile} -p ${pidfile} -f ${procname} --cred-file ${cloudflared_conf} ${cloudflared_mode}" |
32 |
command_args="-o ${logfile} -p ${pidfile} -f ${procname} --config ${cloudflared_conf} ${cloudflared_mode}" |
33 |
|
33 |
|
34 |
run_rc_command "$1" |
34 |
run_rc_command "$1" |