#!@@GOODSH@@ : < =head1 LICENSE GPLv2 =begin comment This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =end comment =head1 MAGIC MARKERS #%# family=manual #%# capabilities=autoconf =cut EOF case $1 in config) cat < cat /proc/net/tcp* | awk ' match ($4, /0[0-9A-B]/) { STATE[$4]++; } END { printf "established.value %d\n", STATE["01"]; printf "syn_sent.value %d\n", STATE["02"]; printf "syn_recv.value %d\n", STATE["03"]; printf "fin_wait1.value %d\n", STATE["04"]; printf "fin_wait2.value %d\n", STATE["05"]; printf "time_wait.value %d\n", STATE["06"]; printf "close.value %d\n", STATE["07"]; printf "close_wait.value %d\n", STATE["08"]; printf "last_ack.value %d\n", STATE["09"]; printf "listen.value %d\n", STATE["0A"]; printf "closing.value %d\n", STATE["0B"]; }'