Last active
August 20, 2023 22:14
-
-
Save jamesog/0b9c8274eeb4719782d9630a3b5d09ee to your computer and use it in GitHub Desktop.
FreeBSD rc script for tailscaled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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