-
-
Save pyetras/130758 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
#!/bin/bash | |
username=$(whoami) | |
proc="$(ps aux | grep $username | grep -v $0 | grep firefox | grep -v grep)" | |
if [ "$proc" != "" ] | |
then | |
echo "shutdown firefox first!" | |
exit 1 | |
fi | |
curdir=$(pwd) | |
for dir in $(cat /Users/Pietras/Library/Application\ Support/Firefox/profiles.ini | grep Path= | sed -e 's/Path=//') | |
do | |
cd /Users/Pietras/Library/Application\ Support/Firefox/$dir 2>/dev/null | |
if [ $? == 0 ] | |
then | |
echo "i'm in $(pwd)" | |
echo -e " running...\n" | |
for F in $(find . -type f -name '*.sqlite' -print) | |
do | |
sqlite3 $F "VACUUM;" | |
done | |
echo -e "done in $(pwd) ...\n" | |
else | |
echo -e "\n !!!! Error while entering directory $dir !!!!\n" | |
fi | |
done | |
echo "Job finished"; | |
cd $curdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment