From c07b0cd5881ae4e101c41ffa7a1dc6980c3ef357 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 27 Feb 2021 13:22:39 -0800 Subject: [PATCH] altosui: Show dialog box if sudo fails on Mac OS X If the user types the wrong password three times, sudo will give up and return an error. Signed-off-by: Keith Packard --- altosui/install-macosx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/altosui/install-macosx b/altosui/install-macosx index 8f0067e5..4aa741e1 100755 --- a/altosui/install-macosx +++ b/altosui/install-macosx @@ -8,6 +8,13 @@ case `id -u` in ;; *) SUDO_ASKPASS="${dir}/ask-pass" sudo -A "$0" "$@" + case $? in + 0) + ;; + *) + osascript -e 'display dialog "Installation failed. Incorrect password?" buttons {"OK"} default button 1 with title "Installation Status"' > /dev/null + ;; + esac exit 0 ;; esac -- 2.30.2