1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-06 11:22:57 +00:00

refine sudo requirement checks for uninstallation.

This commit is contained in:
Tw93
2025-12-17 10:37:03 +08:00
parent b843cde0fd
commit be1027f9c3
5 changed files with 206 additions and 23 deletions

View File

@@ -45,7 +45,7 @@ _request_password() {
# Save original terminal settings and ensure they're restored on exit
local stty_orig
stty_orig=$(stty -g < "$tty_path" 2> /dev/null || echo "")
trap '[[ -n "$stty_orig" ]] && stty "$stty_orig" < "$tty_path" 2> /dev/null || true' RETURN
trap '[[ -n "${stty_orig:-}" ]] && stty "${stty_orig:-}" < "$tty_path" 2> /dev/null || true' RETURN
while ((attempts < 3)); do
local password=""