]]>https://bbs.archlinux.org/profile.php?id=126632013-01-23T22:18:49Zhttps://bbs.archlinux.org/viewtopic.php?pid=1221768#p1221768Arch hasn't used tcp_wrappers for a long time, so this script is redundant. Adapt it to use iptables instead.]]>https://bbs.archlinux.org/profile.php?id=18222013-01-23T12:42:27Zhttps://bbs.archlinux.org/viewtopic.php?pid=1221562#p1221562Using the builtin test [[ rather than [ which is an executable will may be speed the script up. Also, have you thought about using fail2ban instead? It is a python script that runs a daemon and does the same thing.]]>https://bbs.archlinux.org/profile.php?id=658022013-01-23T12:38:31Zhttps://bbs.archlinux.org/viewtopic.php?pid=1221560#p1221560It might help if you said what you actually wanted it to do.

Without knowing the goals, the main thing that jumps out at me is a long awkward series of greps, seds, and awks followed by a loop through each matching element that does some counting and prints out some information. *ALL* that should be replaced by a single awk invocation.