File tree 1 file changed +16
-10
lines changed
src/res/configlets/linux24
1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 12
12
# # {{if var}} is conditional operator.
13
13
# #
14
14
reset_iptables_v4 () {
15
+ local list
16
+
15
17
$IPTABLES {{$opt_wait }} -P OUTPUT DROP
16
18
$IPTABLES {{$opt_wait }} -P INPUT DROP
17
19
$IPTABLES {{$opt_wait }} -P FORWARD DROP
18
20
19
- cat /proc/net/ip_tables_names | while read table; do
20
- $IPTABLES {{$opt_wait }} -t $table -L -n | while read c chain rest; do
21
+ while read table; do
22
+ list=$( $IPTABLES {{$opt_wait }} -t $table -L -n)
23
+ printf " %s" " $list " | while read c chain rest; do
21
24
if test " X$c " = " XChain" ; then
22
25
$IPTABLES {{$opt_wait }} -t $table -F $chain
23
26
fi
24
- done
25
- $IPTABLES {{$opt_wait }} -t $table -X
26
- done
27
+ done
28
+ $IPTABLES {{$opt_wait }} -t $table -X
29
+ done < /proc/net/ip_tables_names
27
30
}
28
31
29
32
reset_iptables_v6 () {
33
+ local list
34
+
30
35
$IP6TABLES {{$opt_wait }} -P OUTPUT DROP
31
36
$IP6TABLES {{$opt_wait }} -P INPUT DROP
32
37
$IP6TABLES {{$opt_wait }} -P FORWARD DROP
33
38
34
- cat /proc/net/ip6_tables_names | while read table; do
35
- $IP6TABLES {{$opt_wait }} -t $table -L -n | while read c chain rest; do
39
+ while read table; do
40
+ list=$( $IP6TABLES {{$opt_wait }} -t $table -L -n)
41
+ printf " %s" " $list " | while read c chain rest; do
36
42
if test " X$c " = " XChain" ; then
37
43
$IP6TABLES {{$opt_wait }} -t $table -F $chain
38
44
fi
39
- done
40
- $IP6TABLES {{$opt_wait }} -t $table -X
41
- done
45
+ done
46
+ $IP6TABLES {{$opt_wait }} -t $table -X
47
+ done < /proc/net/ip6_tables_names
42
48
}
43
49
You can’t perform that action at this time.
0 commit comments