Welcome, Guest. Please login or register.
Did you miss your activation email?
Thursday 26 December 2024, 05:09:21 am

Login with username, password and session length

CLICK HERE for the The official Endian Roadmap and Issue tracker
14262 Posts in 4377 Topics by 6517 Members
Latest Member: Sandro
Search:     Advanced search
+  EFW Support
|-+  Development
| |-+  Contribute Your Customisations & Modifications
| | |-+  Greater Blacklist for 2.5.1
0 Members and 0 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Greater Blacklist for 2.5.1  (Read 26264 times)
JHickman
Jr. Member
*
Offline Offline

Posts: 1


« on: Thursday 24 May 2012, 03:31:00 pm »

After some fidling with the original blacklist updater from jaebird, g.vecchi and portucale I have updated the script as below for 2.5.1 since the file locations changed.

I only later saw RHickman's python aproach but since I don't know python I don't know how its error handling works.

The below script will error out if the downloaded file is corrupt. The original script would continue and Dansgaurdian will fail to start again and/or you will only have a few categories in your dansgaurdian config opening your proxy to all those sites you think you blocked posibly.

I have also added the following line to force curl to use an upstream proxy without a username or password since my box does not have direct internet access and the profile.d workaround did not work for me.

Save this file as /etc/cron.weekly/update_blacklist.sh and execute it

Code:

export http_proxy=Proxy_Server


Due to restrictions on this site you will need to edit the following lines:

export http_proxy=Proxy_Server
curl -C - -O URL_to_Shallalist

Here is my code modification:
Save this file as /etc/cron.weekly/update_blacklist.sh and execute it.

Code:

#!/bin/sh -e

cd /tmp

if [ -a /tmp/shallalist.tar.gz ]
  then
    rm -r /tmp/shallalist.tar.gz
fi
export http_proxy=Proxy_Server
curl -C - -O URL_to_Shallalist

if [ -a /tmp/BL ]
  then
    rm -r /tmp/BL
fi

tar -xvzf shallalist.tar.gz

if [ -a /var/signatures/dansguardian/blacklists.bak ]
  then
    rm -r /var/signatures/dansguardian/blacklists.bak
fi

if [ -a /tmp/shallalist.tar.gz ]
  then


mv /var/signatures/dansguardian/blacklists /var/signatures/dansguardian/blacklists.bak

mkdir /var/signatures/dansguardian/blacklists/

cp -r /tmp/BL/* /var/signatures/dansguardian/blacklists/

rm -r /var/signatures/dansguardian/blacklists/COPYRIGHT

rm -r /var/signatures/dansguardian/blacklists/global_usage

date > /var/signatures/dansguardian/blacklists/updated



# Create categories file
for i in `ls /var/signatures/dansguardian/blacklists/`; do
  if [ "$i" != "categories" ]; then
    echo "$i"="$i" >> /var/signatures/dansguardian/blacklists/categories;
  fi
done

/etc/init.d/dansguardian restart

fi

if [ -a /tmp/shallalist.tar.gz ]
  then
    rm -r /tmp/shallalist.tar.gz
fi

if [ -a /tmp/BL ]
  then
    rm -r /tmp/BL
fi

exit 0








Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Page created in 0.063 seconds with 19 queries.
Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Design by 7dana.com