Bug fixing and improving source code readability

This commit is contained in:
Razvan Stoica 2021-03-29 15:22:14 +03:00
parent 86985f854f
commit d0443cc817
12 changed files with 1028 additions and 783 deletions

View file

@ -24,19 +24,7 @@ readonly myname
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin/"
# Check for required program(s)
req_progs='awk docker grep stat tee tail wc xargs truncate sed'
for p in $req_progs; do
command -v "$p" >/dev/null 2>&1 || { printf "%s command not found.\n" "$p"; exit 1; }
done
if command -v ss >/dev/null 2>&1; then
netbin=ss
elif command -v netstat >/dev/null 2>&1; then
netbin=netstat
else
echo "ss or netstat command not found."
exit 1
fi
req_programs 'awk docker grep stat tee tail wc xargs truncate sed'
# Ensure we can connect to docker daemon
if ! docker ps -q >/dev/null 2>&1; then
@ -85,6 +73,7 @@ fi
logger="log/${myname}.log"
limit=0
printremediation="1"
globalRemediation=""
# Get the flags
# If you add an option here, please
@ -130,7 +119,6 @@ beginjson "$version" "$(date +%s)"
# Load all the tests from tests/ and run them
main () {
logit "\n${bldylw}Section A - Check results${txtrsr}"
globalRemediation=""
# Get configuration location
get_docker_configuration_file