From 4a41c9a1d988bc842ab5378176fa1a73ad6f3be3 Mon Sep 17 00:00:00 2001 From: Daniel MacLaughlin Date: Wed, 19 Jul 2017 18:18:12 +1000 Subject: [PATCH] changes to the dialog box and added user flag and icon --- reissueKey.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reissueKey.sh b/reissueKey.sh index 7895468..4faaba8 100644 --- a/reissueKey.sh +++ b/reissueKey.sh @@ -54,6 +54,9 @@ # -Updated by Jordan Wisniewski on Dec 5, 2016 # -Removed quotes for 'send {${userPass}}' so # passwords with spaces work. +# -Updated by Daniel MacLaughlin on June 17, 2017 +# -changes to run command as sudo -u $username as prompt wasn't displaying accurately +# -added FileVault icon to dialog box # #################################################################################################### # @@ -82,7 +85,7 @@ fi ## Get the logged in user's password via a prompt echo "Prompting ${userName} for their login password." -userPass="$(/usr/bin/osascript -e 'Tell application "System Events" to display dialog "Please enter your login password:" default answer "" with title "Login Password" with text buttons {"Ok"} default button 1 with hidden answer' -e 'text returned of result')" +userPass=$(sudo -u ${userName} /usr/bin/osascript -e 'Tell application "System Events" to display dialog "Please enter your login password to update your Encryption:" default answer "" with title "Login Password" with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" with text buttons {"Ok"} default button 1 with hidden answer' -e 'text returned of result') echo "Issuing new recovery key"