44 lines
1.4 KiB
Bash
Executable File
44 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# Lifted from https://github.com/tailscale/tailscale/issues/9502#issuecomment-1836514959
|
|
# Generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v
|
|
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
|
|
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
|
|
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
|
|
fi
|
|
### BEGIN INIT INFO
|
|
# Provides: tailscaled
|
|
# Required-Start: $remote_fs
|
|
# Required-Stop: $remote_fs
|
|
# Should-Start: $local_fs NetworkManager systemd-resolved
|
|
# Should-Stop: $local_fs NetworkManager systemd-resolved
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Description: Tailscale node agent
|
|
### END INIT INFO
|
|
set -a
|
|
RUNTIME_DIRECTORY=/run/tailscale
|
|
STATE_DIRECTORY=/var/lib/tailscale
|
|
CACHE_DIRECTORY=/var/cache/tailscale
|
|
. /etc/default/tailscaled
|
|
set +a
|
|
|
|
DAEMON=/usr/sbin/tailscaled
|
|
DAEMON_ARGS="--state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port=${PORT} $FLAGS"
|
|
PIDFILE=/var/run/tailscaled-sysd2v.pid
|
|
START_ARGS="--background --make-pidfile --notify-await"
|
|
|
|
do_start_cmd_override ()
|
|
{
|
|
install -d -m 0755 /run/tailscale || return 2
|
|
install -d -m 0700 /var/lib/tailscale || return 2
|
|
install -d -m 0750 /var/cache/tailscale || return 2
|
|
/usr/sbin/tailscaled --cleanup || return 2
|
|
do_start_cmd || return $?
|
|
}
|
|
|
|
do_stop_cmd_override ()
|
|
{
|
|
do_stop_cmd || return $?
|
|
/usr/sbin/tailscaled --cleanup || return 2
|
|
}
|