You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			33 lines
		
	
	
		
			690 B
		
	
	
	
		
			Bash
		
	
			
		
		
	
	
			33 lines
		
	
	
		
			690 B
		
	
	
	
		
			Bash
		
	
#!/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)
 | 
						|
config_dir="$HOME/.mozilla/firefox"
 | 
						|
 | 
						|
for dir in $(cat "$config_dir/profiles.ini" | grep Path= | sed -e s/Path=//)
 | 
						|
do
 | 
						|
    cd $config_dir/$dir 2>/dev/null
 | 
						|
    if [ $? == 0 ]
 | 
						|
    then
 | 
						|
        echo "cleaning $dir"
 | 
						|
        for F in $(find . -type f -name '*.sqlite' -print)
 | 
						|
        do
 | 
						|
            echo -e "vacuum $F"
 | 
						|
            sqlite3 $F "VACUUM;"
 | 
						|
        done
 | 
						|
        echo -e "done in $dir"
 | 
						|
    else
 | 
						|
        echo -e "error entering directory $dir"
 | 
						|
    fi
 | 
						|
done
 | 
						|
 | 
						|
echo "job cleaning";
 | 
						|
cd $curdir
 |