Files
dropshell-templates/tailscale/logs.sh
Your Name 9aa6168f76
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 35s
Add tailscale!
2025-09-07 22:52:10 +12:00

26 lines
639 B
Bash
Executable File

#!/bin/bash
# shellcheck disable=SC1091
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CONTAINER_NAME"
# Tailscale Logs Script
# Optional: follow logs with -f flag
FOLLOW=""
if [ "$1" = "-f" ] || [ "$1" = "--follow" ]; then
FOLLOW="-f"
fi
if ! _is_container_exists "$CONTAINER_NAME"; then
echo "Error: Tailscale container does not exist."
exit 1
fi
echo "Fetching logs from Tailscale container..."
echo "========================================="
docker logs ${FOLLOW} ${CONTAINER_NAME} 2>&1
if [ -z "$FOLLOW" ]; then
echo ""
echo "Tip: Use '${SERVICE_PATH}/logs.sh -f' to follow logs in real-time."
fi