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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.