From 3fe9fe6057ce1565762f7ae18616861af131f007 Mon Sep 17 00:00:00 2001 From: amir-climy Date: Thu, 21 May 2026 23:19:13 +0800 Subject: [PATCH] fix(install): auto-detect non-interactive mode for --purge-data confirmation Co-Authored-By: Claude Sonnet 4.6 --- manage-server/uninstall.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manage-server/uninstall.sh b/manage-server/uninstall.sh index 3334ddf..77b7992 100755 --- a/manage-server/uninstall.sh +++ b/manage-server/uninstall.sh @@ -9,7 +9,7 @@ # sudo bash uninstall.sh --purge-data # also delete DB + binaries volume (interactive) # sudo bash uninstall.sh --purge-data --yes # non-interactive purge (e.g. curl | bash) # --version Print script version and exit. -SCRIPT_VERSION="2026-05-21.5" +SCRIPT_VERSION="2026-05-21.6" set -euo pipefail SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" @@ -51,11 +51,11 @@ fi if [[ $PURGE -eq 1 ]]; then info "DESTRUCTIVE: removing manage server volumes..." info " this deletes: scan history, hosts, users, worker binaries" - if [[ $YES -eq 0 ]]; then + if [[ $YES -eq 1 || ! -t 0 ]]; then + info " non-interactive mode, proceeding automatically" + else read -r -p " Are you sure? Type 'yes' to confirm: " CONFIRM [[ "$CONFIRM" == "yes" ]] || die "aborted" - else - info " --yes flag set, skipping confirmation" fi for vol in triton-manage-db-data triton-manage-bins; do podman volume rm -f "$vol" 2>/dev/null \