Squidguard with autoupdate
-
I am looking for a possibility to autoupdate the blacklist for squidGuard like mentioned in http://forum.pfsense.org/index.php/topic,20983.msg107787.html#msg107787
I found a script to autoupdate:
–-------------------------------------
#!/bin/shshalla_update.sh, v 0.3 20070418
done by kapivie at sil.at under FreeBSD
without any warranty
#--------------------------------------------------
little script (for crond)
to fetch and modify new list from shalla.de
#--------------------------------------------------
check paths and squidGuard-owner on your system
try i.e. "which squid" to find out the path for squid
try "ps aux | grep squid" to find out the owner for squidGuard
# needs wget
squidGuardpath="/usr/local/bin/squidGuard"
squidpath="/usr/local/sbin/squid"
httpget="/usr/local/bin/wget"
tarpath="/usr/bin/tar"
chownpath="/usr/sbin/chown"dbhome="/var/db/squidGuard" # like in squidGuard.conf
squidGuardowner="squid:squid"##########################################
workdir="/tmp"
shallalist="http://www.shallalist.de/Downloads/shallalist.tar.gz"download actual shalla's blacklist
thanks for the " || exit 1 " hint to Rich Wales
$httpget $shallalist -O $workdir/shallalist.tar.gz || exit 1
$tarpath xzf $workdir/shallalist.tar.gz -C $workdir || exit 1remove entry from porn-list: "krone.at"
(too popular in Austria to be forbidden ;-)
grep -vx krone.at $workdir/BL/porn/domains > $workdir/domains
cp $workdir/domains $workdir/BL/porn/
create new local database
rm -r $dbhome
mv $workdir/BL $dbhome
$squidGuardpath -C all$chownpath -R $squidGuardowner $dbhome
$squidpath -k reconfigure
tarbut this one stops when it comes to
$squidGuardpath -C all
I tried the whole script manually and when I enter 'squidGuard -C all' it runs forever.
According to the squidGuard faqs this is the case if you have a blank space in the beginning of your squidguard.conf, but there is no blank space.
When using 'squidGuard -C all -d' you get
4 squidGuard -c all -d
2010—05—21 11:06:49 [7213) New setting: logdir: /var/squidGuard/log
2010—05—21 11:06:49 [7213) New setting: dbhone: /var/db/squidGuard
2010—05—21 11:06:49 [7213] init domainlist /var/db/squidGuard/blkBLadv/domains
2010—05—21 11:06:49 [7213] Error db open: No such file or directory
2010—05—21 11:06:49 [7213] going into emergency mod -
Autoupdate not a simple archive copy/paste.
Need make steps for prepare archive's catalog-structure. And control config for correct blacklist names..