Pitching a script to find improvements and suggestions: Firewall and Network Auditor
Hello all,
Recently I had to write a script to gather and audit some network info from Linux servers. I would appreciate suggestions and improvement tweaks and further inclusions to make the script more robust. - Bellamkonda Sudhakar The script itself: Code:
#!/bin/bash |
That's a lot of code to comment on and it looks pretty tidy; two reasons why nobody has commented?
As said, it's tidy code but some things you might like to consider:
|
I apologize - I need to learn quite q few things. Bear with me .
Still reading script - and catkin's insight was good. I am unsure about command Code:
uname -o Following variable seems unused Code:
TTCPC=`ss -t -a | wc -l` |
Quote:
|
I could go on, but this post is getting to be a bit tiring to work on, so I think I'll stop here. ;) |
I believe the above is plenty enough for you to digest at the moment, so my only addition is a personal view.
The use of a function is generally tied to reducing the need to repeat the same lines of code several times. You have functions like create_workspace which ultimately are only required at one point in the entire script, so I probably would not have worried about creating a function for this example. Look forward to your next revision :) |
Quote:
|
Its just me - I usually get impatient when OP forgets to respond/acknowledge.
|
that's a big WOW, Thanks a lot, in fact you can say that my BASH scripting knowledge is a bit of an ancient relic :) and I have used some of the suggestions in other scripts that i have been writing. I guess that I will rewrite the script and revise it with all there in mind.
I appreciate all you guys and especially Catkin and David the H. @asimba : so that i can use this script in different *nix other than linux, i.e. freebsd etc. hopefully. Thanks a lot. Sudhagud (Till the revised script :) ) |
All times are GMT -5. The time now is 09:36 AM. |