Annotation of embedaddon/miniupnpd/netfilter/ip6tables_init_and_clean.sh, revision 1.1.1.1
1.1 misho 1: #! /bin/sh
2: # $Id: ip6tables_init_and_clean.sh,v 1.1 2012/04/24 22:13:41 nanard Exp $
3: # Improved Miniupnpd iptables init script.
4: # Checks for state of filter before doing anything..
5:
6: EXTIF=eth0
7: IPTABLES=/sbin/ip6tables
8: FDIRTY="`LC_ALL=C /sbin/ip6tables -t filter -L -n | grep 'MINIUPNPD' | awk '{printf $1}'`"
9:
10: if [[ $FDIRTY = "MINIUPNPDChain" ]]; then
11: echo "Filter table dirty; Cleaning..."
12: $IPTABLES -t filter -F MINIUPNPD
13: elif [[ $FDIRTY = "Chain" ]]; then
14: echo "Dirty filter chain but no reference..? Fixsted."
15: $IPTABLES -t filter -I FORWARD 4 -i $EXTIF ! -o $EXTIF -j MINIUPNPD
16: $IPTABLES -t filter -F MINIUPNPD
17: else
18: echo "Filter table clean..initalizing.."
19: $IPTABLES -t filter -N MINIUPNPD
20: $IPTABLES -t filter -I FORWARD 4 -i $EXTIF ! -o $EXTIF -j MINIUPNPD
21: fi
22:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>