This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
-- test for Kerberos ticket presence and attempt to renew | |
do shell script "/usr/bin/klist | /usr/bin/grep krbtgt" | |
do shell script "/usr/bin/kinit -R" | |
on error | |
-- offer to renew Kerberos ticket | |
set response to (display dialog "No Kerberos ticket was found. Do you want to renew it?" with icon 2 buttons {"No", "Yes"} default button "Yes") | |
if button returned of response is "Yes" then | |
try | |
set thePassword to text returned of (display dialog "Enter your password:" default answer "" with hidden answer) |