cookieclean.sh - cleans up the Mozilla cookie file removing unwanted items
cookieclean.sh
none
Just removes those cookies from the Mozilla cookie files which hosts are not enumerated in the permitted hosts file. This way your access to sites depending on cookies is not blocked but the unneccessary cookies disappears overnight. Also the cookies which store useful information for you will remain.
This script was designed to be run from cron, so it outputs its messages to a log file. Excepting of course unexpected and unhandled errors...
Lines starting with hash ( # ) are comments. Comments and empty lines are ignored.
- mozilla
-
Path to the profile directory ( deprecated, use profile key ). This was kept for backward compatibility only. Unlike profile, it can be specified only once.
mozilla=/home/master/.mozilla/default/v5rkwo4n.slt/
- profile
-
Path to the profile directory of a Mozilla browser ( Mozilla, Phoenix, FireBird, SeaMonkey, FireFox ) You can use multiple profile keys. At least one must be specified. ( Unless you use the deprecated mozilla key. )
profile=/home/master/.mozilla/firefox/xie5eflf.default/ profile=/home/master/.mozilla/seamonkey/e81zpwiz.default/ profile=/home/master/.phoenix/default/10z08gzf.slt/ profile=/home/master/.gnome2/epiphany/
- okfile
-
File containing the list of permitted hosts ( see Permitted host file below ). The file's existance is mandatory. If the key is not specified, it defaults to the script name with "-ok.txt" suffix appended.
okfile=${scriptdir}/cookieclean.ok
- badfile
-
File containing the list of found unpermitted hosts. It has the format of a cookies.txt file, even if was extracted from an SQLite database. If the key is not specified, it defaults to the script name with "-bad.txt" suffix appended.
badfile=${scriptdir}/cookieclean.bad
- logfile
-
Activity log file. It contains information about how the script accomplished its job or why not. If the key is not specified, it defaults to the script name with ".log" suffix appended.
logfile=${scriptdir}/${scriptname}.log
- cachefile
-
The cached expression of the transformed permitted host list. It is suitable for easier processing of a cookies.txt file. If the key is not specified, it defaults to the script name with "-cache.txt" suffix appended.
cachefile=/tmp/${scriptname}-cache.txt
- cachefile3
-
The cached expression of the transformed permitted host list. It is suitable for easier processing of a cookies.sqlite database. If the key is not specified, it defaults to the script name with "-cache3.txt" suffix appended.
cachefile3=/tmp/${scriptname}-cache3.txt
Lines starting with hash ( # ) are comments. Comments and empty lines are ignored.
Each line of the file contains a host name as it appears in the cookie. So leading subdomain, dot ( . ) or nothing is significant.
To specify no host, use a dash ( - ) alone in its line.
-
tek-tips.com
rootshell.be
- 0
-
ok, done successfully
- 1
-
ini file not found
- 2
-
ok file not found
- 3
-
no profile defined
The usual environment variables can be used in the configuration file.
-
The configuration file. Actually its name is composed from the script's name and ".ini" extension.
-
The list of permitted hosts. Actually its name is set in the configuration file.
bash(1), sqlite3(1), grep(1), sed(1)
Comments in cookieclean.ini, I hope you kept a clean copy.
Protection against SQL injection.
Maybe an automatically generated cleaning statistic.
No bugs until now. Found bugs can be reported to the author.
Use it healthy.
Feherke