Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FreeBSD rc script for tailscaled
#!/bin/sh
#
# PROVIDE: tailscaled tailscale
# REQUIRE: NETWORKING
. /etc/rc.subr
name="tailscaled"
rcvar="${name}_enable"
load_rc_config $name
: ${tailscaled_enable:="NO"}
: ${tailscaled_state:="/var/db/${name}/${name}.state"}
procname="/usr/local/sbin/${name}"
pidfile="/var/run/${name}/${name}.pid"
pidfile_supervisor="/var/run/${name}/${name}_supervisor.pid"
command="/usr/sbin/daemon"
command_args="-c -S -T tailscaled -p $pidfile -P $pidfile_supervisor $procname --state $tailscaled_state $tailscaled_flags"
stop_postcmd="${name}_poststop"
tailscaled_poststop() {
/sbin/ifconfig tailscale0 destroy
}
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment