From 51ec84db6c2e91d22eda3eeba34fc9786eae0c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=B1=D1=8B=D1=80=D0=B5=D0=B2=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B9?= Date: Tue, 3 Nov 2026 20:44:32 +0300 Subject: [PATCH] uninstall: accept yes with CR/spaces/case, read from tty Co-Authored-By: Claude Opus 5.5 --- uninstall.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 9555d9e..8b6e7c3 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -21,8 +21,10 @@ echo " watchdog, бинарники, $PHOBOS_DIR, $PANEL_DIR" echo "==================================================" if [ "${PURGE:-0}" != "1" ]; then printf "Точно удалить ВСЁ? [yes/NO]: " - read ans - [ "$ans" = "yes" ] || { echo "Отменено."; exit 0; } + read -r ans /dev/null || read -r ans + # tolerate CR from Windows/phone terminals, spaces, case, "да" + ans=$(printf '%s' "$ans" | tr -d '\r[:space:]' | tr '[:upper:]' '[:lower:]') + case "$ans" in yes|y|да|д) ;; *) echo "Отменено (нужно ввести yes)."; exit 0 ;; esac fi IFACE=$(ip route get 8.8.8.8 2>/dev/null | awk '{for(i=1;i