Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
User Journal

Journal jlanthripp's Journal: A simple script (adapted from vandan's spam blacklist)

Here's something I picked up in my /. travels, posted by vandan today. I modified it a little, but it still does basically the same thing. The blacklist is a text file in which each line is an IP address. I keep it in /etc/blacklist. Very simple, very small, and in the words of the original author, it works :)

(BEGIN SCRIPT)
#!/bin/bash

# variables
BLACKLIST=/etc/blacklist
IPTABLES=/sbin/iptables

# Do stuff.
for IP in `cat $BLACKLIST`
do

echo Blacklisting Host: $IP
$IPTABLES -A INPUT -s $IP -j DROP

done
exit 0
(END SCRIPT)

This discussion has been archived. No new comments can be posted.

A simple script (adapted from vandan's spam blacklist)

Comments Filter:

Work is the crab grass in the lawn of life. -- Schulz

Working...