mirror of
https://git.freebsd.org/ports.git
synced 2025-05-15 16:51:52 -04:00
- add notes about tunnel modes - default mode starts a free tunnel, using trycloudflare.com PR: 254854 Reported by: ale@
36 lines
922 B
Bash
36 lines
922 B
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: cloudflared
|
|
# REQUIRE: cleanvar SERVERS
|
|
#
|
|
# Options to configure cloudflared via /etc/rc.conf:
|
|
#
|
|
# cloudflared_enable (bool) Enable service on boot
|
|
# Default: NO
|
|
#
|
|
# cloudflared_conf (str) Config file to use
|
|
# Default: %%ETCDIR%%/config.yml
|
|
#
|
|
# cloudflared_mode (str) Mode to run cloudflared as (e.g. 'tunnel', 'tunnel run'
|
|
# or 'proxy-dns'). Should you use the default, a free
|
|
# tunnel is set up for you.
|
|
# Default: "tunnel"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="cloudflared"
|
|
rcvar="cloudflared_enable"
|
|
logfile="/var/log/cloudflared.log"
|
|
pidfile="/var/run/cloudflared.pid"
|
|
procname="%%PREFIX%%/bin/cloudflared"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${cloudflared_enable:="NO"}
|
|
: ${cloudflared_conf:="%%ETCDIR%%/config.yml"}
|
|
: ${cloudflared_mode:="tunnel"}
|
|
|
|
command="/usr/sbin/daemon"
|
|
command_args="-o ${logfile} -p ${pidfile} -f ${procname} --config ${cloudflared_conf} ${cloudflared_mode}"
|
|
|
|
run_rc_command "$1"
|