mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
* fix min Go version required to build upstream src code; * add 'cloudflared_mode_options' to port's rc script.
41 lines
1.1 KiB
Bash
41 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: cloudflared
|
|
# REQUIRE: cleanvar DAEMON NETWORKING
|
|
#
|
|
# 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',
|
|
# or 'proxy-dns'). Should you use the default, a free
|
|
# tunnel is set up for you.
|
|
# Default: "tunnel"
|
|
#
|
|
# cloudflare_mode_options (str) Additional options used by the mode cloudflared
|
|
# will be running.
|
|
# Default: "--url 127.0.0.1:8080"
|
|
|
|
. /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"}
|
|
: ${cloudflared_mode_options:="--url 127.0.0.1:8080"}
|
|
|
|
command="/usr/sbin/daemon"
|
|
command_args="-o ${logfile} -p ${pidfile} -f ${procname} --config ${cloudflared_conf} ${cloudflared_mode} ${cloudflared_mode_options}"
|
|
|
|
run_rc_command "$1"
|