Files
dropshell-templates/tailscale/stop.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
733 B
Bash
Executable File

#!/bin/bash
# shellcheck disable=SC1091
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CONTAINER_NAME"
# Tailscale Stop Script
echo "Stopping Tailscale container..."
if _is_container_running "$CONTAINER_NAME"; then
# Gracefully disconnect from Tailscale network before stopping
echo "Disconnecting from Tailscale network..."
docker exec ${CONTAINER_NAME} tailscale down 2>/dev/null || true
# Give it a moment to cleanly disconnect
sleep 2
# Stop the container
if _stop_container "$CONTAINER_NAME"; then
echo "Tailscale container stopped successfully."
else
_die "Failed to stop Tailscale container"
fi
else
echo "Tailscale container is not running."
fi