Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Remove Safari history files on logout via shell script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove Safari history files on logout via shell script
Authored by: pingnak on Sep 15, '09 07:59:48PM
And then, naturally, I spot a bug and can't edit it.

#!/bin/bash

#
# Copy/paste this command and point it at wherever you put this script
# sudo defaults write com.apple.loginwindow LogoutHook "/Users/pingnak/scripts/privacy.sh"
#
# To be complete, Safari->Preferences->AutoFill clear all of the checkmarks (it won't remember passwords and forms).
#
# Script runs as root, so make sure this file is protected from casual modification.
#

if [ -d $useroot=/Users/$1 ] 
then 
	useroot=/Users/$1
else
	useroot=~
fi

# Clear Safari History (except for bookmarks).
/usr/bin/find $useroot/Library/Safari/ -not -name Bookmarks.plist -execdir /bin/rm -rf \{\} \;

# Forget cookies
/bin/rm -f $useroot/Library/Cookies/*

# Forget whatever this stuff is
/bin/rm -rf $useroot/Library/Caches/com.apple.Safari

# Forget Flash plugin persistent 'Shared Objects' settings 
/bin/rm -rf $useroot/Library/Preferences/Macromedia/Flash\ Player/#SharedObjects

# Add any additional clean-up here.



[ Reply to This | # ]