Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (8 sloc) 396 Bytes
#!/bin/bash
# Get the last user
lastUserName=$(/usr/bin/defaults read /Library/Preferences/com.apple.loginwindow lastUserName)
# Remove the keychains for that user
/bin/rm -rf /Users/"$lastUserName"/Library/Keychains/*
/bin/rm -rf /Users/"$lastUserName"/Library/Keychains/.f*
# Add to log file
/bin/echo "$(/bin/date) - Keychain deleted for $lastUserName" >> /Library/Logs/RemoveKeychains.log
You can’t perform that action at this time.