#!/bin/sh
# /etc/network/if-up.d/iptables -- Setup iptables if configuration exists.
#
# Right now, we just load general each time we bring up an interface,
# duplicate work that shouldn't matter.  Eventually, we may want to have
# per-interface rules.

set -e

[ -z "$IFACE" ] && exit
if [ -r /etc/iptables/general ] ; then
    iptables-restore < /etc/iptables/general
fi
if [ -r /etc/iptables/$IFACE ] ; then
    iptables-restore < /etc/iptables/$IFACE
else
    exit 0
fi
