Lines 147-153
flush_delete()
Link Here
|
147 |
printf %s "$i " |
147 |
printf %s "$i " |
148 |
$IPTABLES -t $i -F || RETVAL=1 |
148 |
$IPTABLES -t $i -F || RETVAL=1 |
149 |
done |
149 |
done |
150 |
$IPTABLES -F || RETVAL=1 |
|
|
151 |
[ "$RETVAL" -eq 0 ] && |
150 |
[ "$RETVAL" -eq 0 ] && |
152 |
success "Flushing firewall rules" || |
151 |
success "Flushing firewall rules" || |
153 |
failure "Flushing firewall rules" |
152 |
failure "Flushing firewall rules" |
Lines 159-165
flush_delete()
Link Here
|
159 |
printf %s "$i " |
158 |
printf %s "$i " |
160 |
$IPTABLES -t $i -X || RETVAL=1 |
159 |
$IPTABLES -t $i -X || RETVAL=1 |
161 |
done |
160 |
done |
162 |
$IPTABLES -X || RETVAL=1 |
|
|
163 |
[ "$RETVAL" -eq 0 ] && |
161 |
[ "$RETVAL" -eq 0 ] && |
164 |
success "Removing user defined chains" || |
162 |
success "Removing user defined chains" || |
165 |
failure "Removing user defined chains" |
163 |
failure "Removing user defined chains" |
Lines 171-177
flush_delete()
Link Here
|
171 |
printf %s "$i " |
169 |
printf %s "$i " |
172 |
$IPTABLES -t $i -Z || RETVAL=1 |
170 |
$IPTABLES -t $i -Z || RETVAL=1 |
173 |
done |
171 |
done |
174 |
$IPTABLES -Z || RETVAL=1 |
|
|
175 |
[ "$RETVAL" -eq 0 ] && |
172 |
[ "$RETVAL" -eq 0 ] && |
176 |
success "Zeroing packet and byte counters" || |
173 |
success "Zeroing packet and byte counters" || |
177 |
failure "Zeroing packet and byte counters" |
174 |
failure "Zeroing packet and byte counters" |
Lines 179-184
flush_delete()
Link Here
|
179 |
return $RETVAL |
176 |
return $RETVAL |
180 |
} |
177 |
} |
181 |
|
178 |
|
|
|
179 |
unload_modules() |
180 |
{ |
181 |
local t |
182 |
|
183 |
for t in $tables; do |
184 |
local m="${IPV}table_${t}" |
185 |
action "Unloading module $m:" modprobe -r "$m" |
186 |
done |
187 |
return 0 |
188 |
} |
189 |
|
182 |
fwstatus() |
190 |
fwstatus() |
183 |
{ |
191 |
{ |
184 |
local i |
192 |
local i |
Lines 233-239
stop()
Link Here
|
233 |
{ |
241 |
{ |
234 |
if read_tables; then |
242 |
if read_tables; then |
235 |
set_policy ACCEPT && |
243 |
set_policy ACCEPT && |
236 |
flush_delete |
244 |
flush_delete && |
|
|
245 |
unload_modules |
237 |
RETVAL=$? |
246 |
RETVAL=$? |
238 |
else |
247 |
else |
239 |
printf %s $"$IPTABLES firewall is not started" |
248 |
printf %s $"$IPTABLES firewall is not started" |