Skip to content

Instantly share code, notes, and snippets.

@BRMatt
Created February 3, 2012 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BRMatt/1731333 to your computer and use it in GitHub Desktop.
Save BRMatt/1731333 to your computer and use it in GitHub Desktop.
# .profile for bash users.
# Executed on all machines because we do not permit the use of /bin/bash
# as a user's login shell. Note, however, on Linux PCs, /bin/sh is the
# same as /bin/bash.
case $cputype in
linux*)
SHELL=/bin/bash
export SHELL
DOT_FILE=$HOME/.sql3time
SQL_FILE=`echo $HOME/.mozilla/firefox/*.default/urlclassifier3.sqlite`
ps -u $LOGNAME | grep firefox
if [ $? -eq 1 ]; then
# firefox is not running
[ -f $DOT_FILE ] || touch $DOT_FILE
# only invoke once a day at most
DF=`find $DOT_FILE -maxdepth 0 -mtime +7`
if [ "${DF}X" != "X" ]; then
for f in `echo $SQL_FILE`; do
echo "VACUUM;" | sqlite3 $f
done
touch $DOT_FILE
fi
fi
rm -rf .adobe .bluefish .WindowsProfile .cache .libreoffice .macromedia .subversion
;;
*)
SHELL=/bin/bash
export SHELL
exec $SHELL
;;
esac
source $HOME/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment