Created
February 3, 2012 17:40
-
-
Save BRMatt/1731333 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# .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