Files
portainer-agent-tailscale/entrypoint.sh
2025-11-03 19:47:43 +01:00

25 lines
703 B
Bash

#!/bin/sh
set -e
echo "[+] Starting Tailscale daemon..."
/usr/local/bin/tailscaled --state=/var/lib/tailscale/tailscaled.state &
sleep 2
# Prüfen, ob bereits verbunden
if ! tailscale status >/dev/null 2>&1; then
echo "[+] Bringing up Tailscale..."
tailscale up \
--authkey="${TS_AUTHKEY}" \
--login-server="${TS_LOGIN_SERVER:-https://controlplane.tailscale.com}" \
--hostname="${TS_HOSTNAME:-portainer-agent}" \
--accept-dns="${TS_ACCEPT_DNS:-false}" \
--accept-routes="${TS_ACCEPT_ROUTES:-true}"
else
echo "[+] Existing Tailscale session found, skipping login."
fi
echo "[+] Tailscale IP: $(tailscale ip -4 || true)"
echo "[+] Starting Portainer Agent..."
exec /app/agent