#!/bin/sh
#	antispoofppp-down 0.03
#
#	Copyright (C) 2000:	Manel Marin <manel3@wanadoo.es>
#	Licence:		GNU GPL version >= 2
#
#	Quitar de cortafuegos regla antispoof a la IP dinamica asignada por
#	el ISP a la conexin PPP y registrar en el log la desconexin
#

exec 2>&1	# Enviar errores a stdout ( Gracias a Luis Colorado ;)
PATH=/usr/lib/firewall-easy:/sbin:/usr/sbin:/bin:/usr/bin


IFACE_INET=$PPP_IFACE
IP_DINAMICA=$PPP_LOCAL


echo "`date '+%b %d %H:%M:%S'` antispoofppp-down:\
  Removing antispoof rule of IP $IP_DINAMICA asigned to $IFACE_INET"


# LANZAR EL SCRIPT ADECUADO AL KERNEL
runfwscript antispoofppp-down	# Esto lanza *-ipchains, etc...


# MENSAJE DE DESCONEXION
logger -p daemon.warn -t pppd -- "----------Disconnected: $PPP_IFACE"

# FIREWALL-LIST -> LOG
firewall-list > /var/log/firewall-list.lastppp
