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
+3 -3
View File
@@ -279,8 +279,8 @@ geoip2 /usr/share/GeoIP/GeoLite2-City.mmdb {
fi fi
# Collect server_name values from nginx configs to build same-site referer map # Collect server_name values from nginx configs to build same-site referer map
local REFERER_ENTRIES="" REFERER_ENTRIES=""
local _jsc_domain_seen=() _jsc_domain_seen=()
for _conf in /etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/*; do for _conf in /etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/*; do
[[ -f "$_conf" ]] || continue [[ -f "$_conf" ]] || continue
while read -r _sn; do while read -r _sn; do
@@ -289,7 +289,7 @@ fi
_d="${_d%;}" _d="${_d%;}"
[[ " ${_jsc_domain_seen[*]:-} " == *" $_d "* ]] && continue [[ " ${_jsc_domain_seen[*]:-} " == *" $_d "* ]] && continue
_jsc_domain_seen+=("$_d") _jsc_domain_seen+=("$_d")
local _d_escaped="${_d//./\\.}" _d_escaped="${_d//./\\.}"
REFERER_ENTRIES+=" ~^1:https?://${_d_escaped} 1;\n" REFERER_ENTRIES+=" ~^1:https?://${_d_escaped} 1;\n"
done done
done < <(grep -oP '^\s*server_name\s+\K[^;]+;?' "$_conf" 2>/dev/null) done < <(grep -oP '^\s*server_name\s+\K[^;]+;?' "$_conf" 2>/dev/null)
+3 -3
View File
@@ -117,7 +117,7 @@ fetch_cert() {
local host="$1" port="$2" pem_file local host="$1" port="$2" pem_file
pem_file="${CERT_TMP}/${host}_${port}.pem" pem_file="${CERT_TMP}/${host}_${port}.pem"
verbose "Fetching certificate from ${host}:${port}" verbose "Fetching certificate from ${host}:${port}"
if echo | timeout "${CONNECT_TIMEOUT}" openssl s_client \ if timeout "${CONNECT_TIMEOUT}" openssl s_client \
-connect "${host}:${port}" \ -connect "${host}:${port}" \
-servername "${host}" \ -servername "${host}" \
-showcerts < /dev/null 2>/dev/null \ -showcerts < /dev/null 2>/dev/null \
@@ -134,11 +134,11 @@ fetch_cert() {
fetch_chain() { fetch_chain() {
local host="$1" port="$2" chain_file local host="$1" port="$2" chain_file
chain_file="${CERT_TMP}/${host}_${port}_chain.pem" chain_file="${CERT_TMP}/${host}_${port}_chain.pem"
echo | timeout "${CONNECT_TIMEOUT}" openssl s_client \ timeout "${CONNECT_TIMEOUT}" openssl s_client \
-connect "${host}:${port}" \ -connect "${host}:${port}" \
-servername "${host}" \ -servername "${host}" \
-showcerts < /dev/null 2>"${CERT_TMP}/s_client_err.txt" \ -showcerts < /dev/null 2>"${CERT_TMP}/s_client_err.txt" \
> "${chain_file}" 2>/dev/null || true > "${chain_file}" || true
if [[ -s "${chain_file}" ]]; then if [[ -s "${chain_file}" ]]; then
echo "${chain_file}" echo "${chain_file}"
fi fi
+3 -3
View File
@@ -367,8 +367,8 @@ geoip2 /usr/share/GeoIP/GeoLite2-City.mmdb {
fi fi
# Collect server_name values from nginx configs to build same-site referer map # Collect server_name values from nginx configs to build same-site referer map
local REFERER_ENTRIES="" REFERER_ENTRIES=""
local _jsc_domain_seen=() _jsc_domain_seen=()
for _conf in /etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/*; do for _conf in /etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/*; do
[[ -f "$_conf" ]] || continue [[ -f "$_conf" ]] || continue
while read -r _sn; do while read -r _sn; do
@@ -377,7 +377,7 @@ fi
_d="${_d%;}" _d="${_d%;}"
[[ " ${_jsc_domain_seen[*]:-} " == *" $_d "* ]] && continue [[ " ${_jsc_domain_seen[*]:-} " == *" $_d "* ]] && continue
_jsc_domain_seen+=("$_d") _jsc_domain_seen+=("$_d")
local _d_escaped="${_d//./\\.}" _d_escaped="${_d//./\\.}"
REFERER_ENTRIES+=" ~^1:https?://${_d_escaped} 1;\n" REFERER_ENTRIES+=" ~^1:https?://${_d_escaped} 1;\n"
done done
done < <(grep -oP '^\s*server_name\s+\K[^;]+;?' "$_conf" 2>/dev/null) done < <(grep -oP '^\s*server_name\s+\K[^;]+;?' "$_conf" 2>/dev/null)
+1 -1
View File
@@ -775,7 +775,7 @@ cmd_status() {
echo echo
echo -e "# ${BOLD}TLS Certificates${NC}" echo -e "# ${BOLD}TLS Certificates${NC}"
for d in "$DOMAIN"; do for d in $DOMAIN; do
local cert="/etc/letsencrypt/live/${d}/fullchain.pem" local cert="/etc/letsencrypt/live/${d}/fullchain.pem"
if [[ -f "$cert" ]]; then if [[ -f "$cert" ]]; then
local expiry local expiry