Add tailscale!
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 35s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 35s
This commit is contained in:
26
tailscale/logs.sh
Executable file
26
tailscale/logs.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
Reference in New Issue
Block a user