Fix 'shorewall reset'

This commit is contained in:
Tom Eastep 2009-05-31 10:21:37 -07:00
parent 793a929051
commit 7b20cf2af9
4 changed files with 9 additions and 34 deletions

View File

@ -9,6 +9,8 @@ Changes in Shorewall 4.3.12
4) Add TOS and LENGTH columns to tcfilters file.
5) Fix 'reset' command.
Changes in Shorewall 4.3.11
1) Reduce the number of arguments passed in may cases.

View File

@ -835,39 +835,6 @@ restore_command() {
fi
}
#
# Reset command executor
#
reset_command() {
if ! shorewall_is_started ; then
echo "Shorewall Not Started"
exit 2;
fi
if [ $# -eq 0 ]; then
$IPTABLES -Z
$IPTABLES -t nat -Z
$IPTABLES -t raw -Z
$IPTABLES -t mangle -Z
report "Shorewall Counters Reset"
date > ${VARDIR}/restarted
else
for chain in $@; do
if chain_exists $chain; then
if qt $IPTABLES -Z $chain; then
progress_message3 "Filter table $chain Counters Reset"
else
error_message "ERROR: Reset of chain $chain failed"
status=2
break
fi
else
error_message "WARNING: Filter Chain $chain does not exist"
fi
done
fi
}
#
# Display the time that the counters were last reset
#

View File

@ -99,6 +99,10 @@ released late in 2009.
eliminated. The log message occurred when an interface with a large
OUT-BANDWIDTH was defined in /etc/shorewall/tcdevices.
2) The 'shorewall reset' command no longer generates this error:
/sbin/shorewall: 885: report: not found
----------------------------------------------------------------------------
K N O W N P R O B L E M S R E M A I N I N G
----------------------------------------------------------------------------

View File

@ -1738,9 +1738,11 @@ case "$COMMAND" in
;;
reset)
get_config
export NOROUTES
shift
mutex_on
reset_command $@
[ -x $FIREWALL ] || fatal_error "Shorewall has never been started"
$SHOREWALL_SHELL $FIREWALL $debugging $nolock reset $@
mutex_off
;;
compile)