mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Make 'show connections' work on ancient distros
This commit is contained in:
parent
077aa18a2d
commit
3898edfddb
@ -520,19 +520,27 @@ show_command() {
|
|||||||
|
|
||||||
g_ipt_options="$g_ipt_options $g_ipt_options1"
|
g_ipt_options="$g_ipt_options $g_ipt_options1"
|
||||||
|
|
||||||
|
|
||||||
[ -n "$g_debugging" ] && set -x
|
[ -n "$g_debugging" ] && set -x
|
||||||
case "$1" in
|
case "$1" in
|
||||||
connections)
|
connections)
|
||||||
[ $# -gt 1 ] && usage 1
|
[ $# -gt 1 ] && usage 1
|
||||||
if mywhich conntrack ; then
|
|
||||||
|
if [ -d /proc/sys/net/netfilter/ ]; then
|
||||||
|
local count
|
||||||
|
local max
|
||||||
|
count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
|
||||||
|
max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
|
||||||
|
echo "$g_product $SHOREWALL_VERSION Connections ($count out of $max) at $g_hostname - $(date)"
|
||||||
|
else
|
||||||
echo "$g_product $SHOREWALL_VERSION Connections at $g_hostname - $(date)"
|
echo "$g_product $SHOREWALL_VERSION Connections at $g_hostname - $(date)"
|
||||||
echo
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
if qt mywhich conntrack ; then
|
||||||
conntrack -f ipv4 -L
|
conntrack -f ipv4 -L
|
||||||
else
|
else
|
||||||
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
|
|
||||||
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
|
|
||||||
echo "$g_product $SHOREWALL_VERSION Connections ($count out of $max) at $g_hostname - $(date)"
|
|
||||||
echo
|
|
||||||
[ -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
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user