Changeset 2905 for trunk


Ignore:
Timestamp:
Jan 18, 2010, 3:32:44 AM (15 years ago)
Author:
gdb
Message:

Make sed not hang when there are no firewall files

Location:
trunk/packages/invirt-iptables/debian
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-iptables/debian/changelog

    r2861 r2905  
     1invirt-iptables (1.0.1) unstable; urgency=low
     2
     3  * Make sed not hang when there are no firewall files
     4
     5 -- Greg Brockman <gdb@mit.edu>  Mon, 18 Jan 2010 03:30:21 -0500
     6
    17invirt-iptables (1) unstable; urgency=low
    28
  • trunk/packages/invirt-iptables/debian/invirt-iptables.init

    r2862 r2905  
    2323        echo 1 > /proc/sys/net/ipv4/ip_forward
    2424
    25         for table in $(sed -ne 's/^*//p' $(run-parts --list "$RULES")); do
    26             iptables -t "$table" -F
    27         done
    28         cat $(run-parts --list "$RULES") | iptables-restore -n
     25        list=$(run-parts --list "$RULES")
     26
     27        if [ ! -z "$list" ]; then
     28            for table in $(sed -ne 's/^*//p' $list); do
     29                iptables -t "$table" -F
     30            done
     31            cat $list | iptables-restore -n
     32        fi
    2933}
    3034
Note: See TracChangeset for help on using the changeset viewer.