document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2. # Criado em:Dom 15/Ago/2010 hs 11:38
  3. # Last Change: Seg 16/Ago/2010 hs 06:44
  4. # vim:ft=sh:fdm=syntax:nu:
  5. # Instituicao: none
  6. # Proposito do script: otimizar a base de dados do firefox
  7. # Autor: Sérgio Luiz Araújo Silva
  8. # site: http://vivaotux.blogspot.com
  9. # fonte:  http://andrenoel.com.br/2009/07/27/melhorando-a-performance-do-firefox-aspirando-o-sqlite/
  10.  
  11.  
  12. function optimaze-firefox () {
  13.     #optimizing Firefox sqlite databases
  14.     [ -z "`whereis sqlite | awk \'{print $2}\'`" ] && echo instale o sqlite
  15.     firefox="`find ~/.mozilla/ -iname "*.default"`"
  16.     opt_lock="$firefox/optimize-sqlite"
  17.     today=$(date +%F)
  18.    
  19.     if [ -n "`pidof firefox-bin`" ]; then
  20.         clear
  21.         echo "para limpar o cache do firefox feche o mesmo"
  22.         echo "e rode este script novamete"
  23.         exit 1
  24.     fi
  25.  
  26.     cd $firefox
  27.     if [ -e $opt_lock ]
  28.     then
  29.         last_run=$(ls -l $opt_lock | awk \'{print $6}\')
  30.     else
  31.         last_run=\'1900-01-01\'
  32.     fi
  33.  
  34.     if [ $last_run != $today ]
  35.     then
  36.         cd $firefox
  37.         echo -n "Optimizing Firefox… "
  38.         for i in *.sqlite
  39.         do
  40.             sqlite3 $i vacuum
  41.             echo -n \'+\'
  42.         done
  43.         echo
  44.         touch $opt_lock
  45.         echo "Done."
  46.     fi
  47.     cd ~/
  48. }
  49.  
  50. optimaze-firefox
');