All pastes #417259 Raw Edit

Unnamed

public shellscript v1 · immutable
#417259 ·published 2007-03-30 19:28 UTC
rendered paste body
#!/bin/bashfunction check() {info=`cat /var/log/wirefall | grep ^${1}`if [ "$info" != "" ]then	echo "Error: \"$1\" already blocked/unlocked"	exit 1fi}if [ ! -e /var/log/wirefall ]then touch /var/log/wirefallfiif [ "$2" == "on" ]then	check        APPEND="-A"        INSERT="-I"	echo $1 >> /var/log/wirefallelif [ "$2" == "off" ]then	check        APPEND="-D"        INSERT="-D"	cat /var/log/wirefall | grep -v $1 > /var/log/delete && mv /var/log/delete /var/log/wirefallelse	echo "Error: \"off\" or \"on\" expected as second argument"	exit 1fi	#iptables $INSERT INPUT   -s $1 -j DROP#iptables $INSERT OUTPUT  -d $1 -j DROP#iptables $INSERT FORWARD -d $1 -j DROP #echo "IP \"${1}\" drop ${2}."exit 0