install.fairie/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_59-connect-tailscale

7 lines
325 B
Bash

#!/usr/bin/env bash
### Connect to Tailscale network
if command -v tailscale > /dev/null && [ "{{ .user.TAILSCALE_AUTH_KEY }}" != "" ]; then
logg info 'Connecting to Tailscale with user-defined authentication key'
tailscale up --authkey={{ .user.TAILSCALE_AUTH_KEY }} && logg success 'Connected to Tailscale network'
fi