I am returning to live coding sessions with a small tool I use on my servers: counting open connections by IP address. Originally, it is almost an alias. I want to turn it into a cleaner Bash script, with output that is easy to process and use with my blacklisting tools.
I break the work down into functions to retrieve addresses, count and sort connections, ignore certain IPs and optionally display their reverse DNS. I build the processing progressively, starting from commands I already use for manual checks.
First test: the script produces absolutely nothing. I had simply forgotten to call the main function. Once that is fixed, I check the options, then move to a server with more traffic to see how it behaves in real conditions. Mission accomplished.
All my links, projects and social media: https://all.bo
