File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / miniupnpd / netfilter / ip6tables_init_and_clean.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 00:32:35 2013 UTC (11 years ago) by misho
Branches: elwix, MAIN
CVS tags: v1_8p0, v1_8, HEAD
1.8

    1: #! /bin/sh
    2: # $Id: ip6tables_init_and_clean.sh,v 1.1.1.1 2013/07/22 00:32:35 misho 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>