#!/bin/bash # shellcheck disable=SC1091 source "${AGENT_PATH}/common.sh" _check_required_env_vars "CONTAINER_NAME" "STATE_VOLUME" # Tailscale Uninstallation Script echo "Uninstalling Tailscale service..." # Stop the container if it's running if _is_container_running "$CONTAINER_NAME"; then echo "Stopping Tailscale container..." _stop_container "$CONTAINER_NAME" fi # Remove the container if _is_container_exists "$CONTAINER_NAME"; then echo "Removing Tailscale container..." _remove_container "$CONTAINER_NAME" fi echo "Tailscale service has been uninstalled." echo "" echo "Note: The Tailscale state volume (${STATE_VOLUME}) has been preserved." echo "This maintains your Tailscale node configuration and keys." echo "To completely remove all data, run:" echo " docker volume rm ${STATE_VOLUME}" echo "" echo "You may also want to remove this node from your Tailscale admin console."