#! /bin/sh

# quit if we're called for the loopback
if [ "$IFACE" = lo ]; then
	exit 0
fi

# or if the configuration does not exist
if [ ! -r  /etc/firestarter/configuration ]; then
	exit 0
fi

# Retrieve the configuration values

. /etc/firestarter/configuration

# Check if we have the values we need to proceed
if [ -z "$IF" ] || [ -z "$INIF" ] ; then
	exit 0
fi

# Are we being called for the same interfaces we are configured with?
if [ "$IFACE" != "$IF" ] && [ "$IFACE" != "$INIF" ] ; then
	exit 0
fi

# If all the other checks succeed, then restart the firewall
invoke-rc.d firestarter restart

