mirror of
https://github.com/RipleyBooya/ssh-tunnel.git
synced 2025-12-13 00:18:37 +01:00
Update entrypoint.tailscale.sh
remove TAILSCALE_AUTHKEY for now and replace it with TAILSCALE_PARAM
This commit is contained in:
parent
28e32d81db
commit
b230c873b3
1 changed files with 8 additions and 12 deletions
|
|
@ -8,23 +8,19 @@ if [ -z "$SSH_HOST" ] || [ -z "$SSH_USER" ] || [ -z "$REMOTE_PORTS" ] || [ -z "$
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Vérifier que TAILSCALE_PARAM est défini
|
||||
if [ -z "$TAILSCALE_PARAM" ]; then
|
||||
echo "ERROR: TAILSCALE_PARAM is required but not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Démarrage de Tailscale
|
||||
echo "Starting Tailscale..."
|
||||
tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock &
|
||||
|
||||
sleep 5
|
||||
echo "Connecting to Tailscale..."
|
||||
|
||||
# Vérifier si TAILSCALE_PARAM est défini, sinon utiliser la clé d'authentification par défaut
|
||||
if [ -n "$TAILSCALE_PARAM" ]; then
|
||||
tailscale up $TAILSCALE_PARAM
|
||||
else
|
||||
if [ -z "$TAILSCALE_AUTH_KEY" ]; then
|
||||
echo "ERROR: Either TAILSCALE_PARAM or TAILSCALE_AUTH_KEY must be set."
|
||||
exit 1
|
||||
fi
|
||||
tailscale up --authkey=${TAILSCALE_AUTH_KEY} --ssh
|
||||
fi
|
||||
echo "Connecting to Tailscale with: tailscale up ${TAILSCALE_PARAM}"
|
||||
tailscale up ${TAILSCALE_PARAM}
|
||||
|
||||
# Vérifier que Tailscale est bien actif
|
||||
if ! tailscale status; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue