Skip to content

Instantly share code, notes, and snippets.

@omtinez
Last active February 2, 2021 11:40
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save omtinez/8e05f4609cec76edb00d9420234b2ac3 to your computer and use it in GitHub Desktop.
Save omtinez/8e05f4609cec76edb00d9420234b2ac3 to your computer and use it in GitHub Desktop.
Blacklist auto-update for SquidGuard
#!/bin/sh
# Configure this section according to your system settings
squidGuardpath="/usr/bin/squidGuard"
squidpath="/usr/sbin/squid3"
httpget="/usr/bin/wget"
tarpath="/bin/tar"
chownpath="/bin/chown"
dbhome="/var/lib/squidguard/db" # same as squidguard.conf
squidGuardowner="proxy:www"
workdir="/tmp"
# download actual shalla's blacklist
shallalist="http://www.shallalist.de/Downloads/shallalist.tar.gz"
$httpget $shallalist -O $workdir/shallalist.tar.gz || exit 1
$tarpath xzf $workdir/shallalist.tar.gz -C $workdir || exit 1
# create new local database
rm -r $dbhome
mv $workdir/BL $dbhome
# clean-up
$squidGuardpath -C all
$chownpath -R $squidGuardowner $dbhome
$squidpath -k reconfigure
@beeyev
Copy link

beeyev commented May 21, 2019

thanks man

@kangpaidjo
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment