File: adblock.sh

package info (click to toggle)
firehol 1.273-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 948 kB
  • ctags: 314
  • sloc: sh: 5,132; makefile: 70
file content (26 lines) | stat: -rwxr-xr-x 678 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
# $Id: adblock.sh,v 1.1 2003/10/07 23:42:17 ktsaou Exp $
# A script that will fetch the IPs of popular add servers.
#
# To use this, just put in your cron jobs, like this:
#
#      0 * * * * /path/to/adblock.sh >/etc/firehol/adblock-ips
#
# and then in your firehol.conf:
#
#     source /etc/firehol/adblock-ips
#
# later in the config file you can use (for example)
#
#     client http accept dst not "${ADSERVERS_IPS}"
#
# or even:
#
#     blacklist full "${ADSERVERS_IPS}"
#
#

printf "ADSERVERS_IPS=\""
printf "%q " `wget -q -O - "http://pgl.yoyo.org/adservers/iplist.php?ipformat=plain&showintro=0" | egrep -e "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\$"`
printf "\"\n"