Add 4 and update 2 files

This commit is contained in:
Your Name
2025-09-08 17:46:34 +12:00
parent 308e0e3bc6
commit 6880a0e321
6 changed files with 392 additions and 173 deletions

View File

@@ -75,12 +75,27 @@ if [ -n "$TAILSCALE_EXTRA_ARGS" ]; then
TAILSCALE_UP_CMD="${TAILSCALE_UP_CMD} ${TAILSCALE_EXTRA_ARGS}"
fi
# Execute tailscale up command
if ! docker exec ${CONTAINER_NAME} ${TAILSCALE_UP_CMD}; then
echo "Warning: Failed to connect to Tailscale network automatically."
echo "You may need to connect manually using:"
echo " docker exec ${CONTAINER_NAME} tailscale up"
fi
# Execute tailscale up command with retries
RETRY_COUNT=0
MAX_RETRIES=5
RETRY_DELAY=10
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if docker exec ${CONTAINER_NAME} ${TAILSCALE_UP_CMD}; then
echo "Successfully connected to Tailscale network!"
break
else
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
echo "Connection attempt $RETRY_COUNT failed. Retrying in ${RETRY_DELAY} seconds..."
sleep $RETRY_DELAY
else
echo "Warning: Failed to connect after $MAX_RETRIES attempts."
echo "You may need to connect manually using:"
echo " docker exec ${CONTAINER_NAME} tailscale up"
fi
fi
done
echo ""
echo "Tailscale started successfully!"