All pastes #416901 Raw Edit

Wirefall

public shellscript v1 · immutable
#416901 ·published 2007-03-30 15:58 UTC
rendered paste body
#!/bin/bashif [ ! -e /var/log/wirefall ]then touch /var/log/wirefallfiif [ "$2" == "on" ]then	log_check	echo $1 >> /var/log/wirefallelif [ "$2" == "off" ]then	log_check	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	log_check() {info=`cat /var/log/wirefall | grep ^${1}`if [ "$info" != "" ]then	echo "Error: $1 already blocked/unlocked"	exit 1fi}iptables $INSERT INPUT   -s $1 -j DROPiptables $INSERT OUTPUT  -d $1 -j DROPiptables $INSERT FORWARD -d $1 -j DROP echo "IP ${1} drop ${2}."exit