mirror of
https://git.freebsd.org/ports.git
synced 2025-05-31 02:16:27 -04:00
security/tailscale: Add suupport for extra arguments
Add a rc.conf variable to support passing extra arguments to tailscale up. Thanks to Gregory for advicing on the implementation. Reported by: Gregory Shapiro <gshapiro at gshapiro dot net>
This commit is contained in:
parent
4b8953300f
commit
1e38c92fd1
2 changed files with 8 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
PORTNAME= tailscale
|
||||
PORTVERSION= 1.32.0
|
||||
PORTREVISION= 1
|
||||
DISTVERSIONPREFIX= v
|
||||
CATEGORIES= security net-vpn
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
# Default is "daemon". See daemon(8).
|
||||
# tailscaled_exitnode_enable (bool): Set it to YES to announce tailscaled as
|
||||
# an exit node. Default is "NO".
|
||||
# tailscaled_up_args (str): Additional arguments to pass to tailscale up
|
||||
# Default is "" (empty string).
|
||||
# tailscaled_tun_dev (str): Set the name of the tun interface tailscaled creates.
|
||||
# Default is "tailscale0"
|
||||
|
||||
|
@ -32,6 +34,7 @@ load_rc_config $name
|
|||
: ${tailscaled_enable:="NO"}
|
||||
: ${tailscaled_port:="41641"}
|
||||
: ${tailscaled_exitnode_enable:="NO"}
|
||||
: ${tailscaled_up_args:=""}
|
||||
: ${tailscaled_tun_dev:="tailscale0"}
|
||||
|
||||
DAEMON=$(/usr/sbin/daemon 2>&1 | grep -q syslog ; echo $?)
|
||||
|
@ -78,7 +81,10 @@ tailscaled_poststart()
|
|||
{
|
||||
if checkyesno tailscaled_exitnode_enable; then
|
||||
logger -s -t tailscale "Enabling Exit node mode"
|
||||
${ctlname} up --advertise-exit-node
|
||||
tailscaled_up_args=" --advertise-exit-node ${tailscaled_up_args}"
|
||||
fi
|
||||
if [ -n "${tailscaled_up_args}" ]; then
|
||||
${ctlname} up ${tailscaled_up_args}
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue