tailscale-docker/images/tailscale/start.sh

13 lines
384 B
Bash
Raw Normal View History

#!/bin/ash
trap 'kill -TERM $PID' TERM INT
echo "Starting Tailscale daemon"
# -state=mem: will logout and remove ephemeral node from network immediately after ending.
2023-12-28 19:25:49 +00:00
tailscaled --tun=userspace-networking --state=${TS_STATE_ARG} ${TS_OPT} &
PID=$!
2023-12-28 19:25:49 +00:00
until tailscale up --authkey="${TS_AUTH_KEY}" --hostname="${TS_HOSTNAME}"; do
sleep 0.1
done
tailscale status
wait ${PID}
wait ${PID}