Fixed shellcheck warning SC2004, SC2006, SC2129, SC2219. Issue #1233.

SC2004: "$/${} is unnecessary on arithmetic variables."
SC2006: "Use $(...) notation instead of legacy backticked `...`."
SC2129: "Consider using { cmd1; cmd2; } >> file instead of individual redirects."
SC2219: "Instead of 'let expr', prefer (( expr ))."
This commit is contained in:
Dundar Göc 2021-02-07 21:20:48 +01:00
parent d67095f3ef
commit 513c2afc2e
7 changed files with 35 additions and 25 deletions

View file

@ -60,7 +60,7 @@ if [[ -z "${CERTS_TO_REVOKE}" ]]; then
# Prevent printing "server" certificate
CERTS[$i]=$(echo -e "${NAME}")
fi
let i=i+1
((i++))
fi
done <${INDEX}
@ -82,7 +82,7 @@ if [[ -z "${CERTS_TO_REVOKE}" ]]; then
re='^[0-9]+$'
if [[ ${NAME} =~ $re ]] ; then
NAME=${CERTS[$(($NAME))]}
NAME=${CERTS[$((NAME))]}
fi
for((x=1;x<=i;++x)); do
@ -104,7 +104,7 @@ else
if [[ "${STATUS}" = "V" ]]; then
NAME=$(echo -e "$line" | sed -e 's:.*/CN=::')
CERTS[$i]=${NAME}
let i=i+1
((i++))
fi
done <${INDEX}