Make dump work correctly on RHEL5

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2014-08-12 16:18:42 -07:00
parent 6f777098d7
commit bf5be7198b

View File

@ -1470,10 +1470,22 @@ do_dump_command() {
$g_tool -t rawpost -L $g_ipt_options $g_tool -t rawpost -L $g_ipt_options
fi fi
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count) local count
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max) local max
heading "Conntrack Table ($count out of $max)" if [ -f /proc/sys/net/netfilter/nf_conntrack_count ]; then
count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
heading "Conntrack Table ($count out of $max)"
elif [ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_count ]; then
count=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count)
max=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max)
heading "Conntrack Table ($count out of $max)"
else
heading "Conntrack Table"
fi
if [ $g_family -eq 4 ]; then if [ $g_family -eq 4 ]; then
[ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack [ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack