Fix ShellCheck errors: remove local outside functions, fix openssl redirections, unquote loop var
Lint Scripts / shellcheck (push) Failing after 14m30s
Lint Scripts / powershell-lint (push) Failing after 15m29s

This commit is contained in:
2026-05-25 05:28:31 +02:00
parent 62139b3377
commit 515c9843dd
4 changed files with 12 additions and 12 deletions
+5 -5
View File
@@ -117,10 +117,10 @@ fetch_cert() {
local host="$1" port="$2" pem_file
pem_file="${CERT_TMP}/${host}_${port}.pem"
verbose "Fetching certificate from ${host}:${port}"
if echo | timeout "${CONNECT_TIMEOUT}" openssl s_client \
if timeout "${CONNECT_TIMEOUT}" openssl s_client \
-connect "${host}:${port}" \
-servername "${host}" \
-showcerts </dev/null 2>/dev/null \
-showcerts < /dev/null 2>/dev/null \
| openssl x509 -outform PEM > "${pem_file}" 2>/dev/null; then
if [[ -s "${pem_file}" ]]; then
echo "${pem_file}"
@@ -134,11 +134,11 @@ fetch_cert() {
fetch_chain() {
local host="$1" port="$2" chain_file
chain_file="${CERT_TMP}/${host}_${port}_chain.pem"
echo | timeout "${CONNECT_TIMEOUT}" openssl s_client \
timeout "${CONNECT_TIMEOUT}" openssl s_client \
-connect "${host}:${port}" \
-servername "${host}" \
-showcerts </dev/null 2>"${CERT_TMP}/s_client_err.txt" \
> "${chain_file}" 2>/dev/null || true
-showcerts < /dev/null 2>"${CERT_TMP}/s_client_err.txt" \
> "${chain_file}" || true
if [[ -s "${chain_file}" ]]; then
echo "${chain_file}"
fi