#!/bin/sh
cd ${0%${0##*/}}.
. ./conf.sh


IP=$1

date  >> ./log/manad.out

echo `/sbin/iptables -D $WIFI_CHAIN_NAME -t nat -j ACCEPT -s $IP` >> ./log/manad.out 2>&1
echo `/sbin/iptables -D $WIFI_CHAIN_NAME -t nat -j ACCEPT -d $IP` >> ./log/manad.out 2>&1

#RST packets for dropping estblished connections  
echo `/sbin/iptables -D FORWARD -j ACCEPT -s $IP` >> ./log/manad.out 2>&1
echo `/sbin/iptables -D FORWARD -j ACCEPT -d $IP` >> ./log/manad.out 2>&1


if [ $USE_MANAD -eq 1 ]; then
./tell_manad.pl "remove $IP" $MANAD_PORT
fi
