From: Keith Packard Date: Sat, 27 Feb 2021 21:22:39 +0000 (-0800) Subject: altosui: Show dialog box if sudo fails on Mac OS X X-Git-Tag: 1.9.7~1^2~26 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c07b0cd5881ae4e101c41ffa7a1dc6980c3ef357 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 --- 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