Fix ShellCheck errors: remove local outside functions, fix openssl redirections, unquote loop var
This commit is contained in:
@@ -279,8 +279,8 @@ geoip2 /usr/share/GeoIP/GeoLite2-City.mmdb {
|
||||
fi
|
||||
|
||||
# Collect server_name values from nginx configs to build same-site referer map
|
||||
local REFERER_ENTRIES=""
|
||||
local _jsc_domain_seen=()
|
||||
REFERER_ENTRIES=""
|
||||
_jsc_domain_seen=()
|
||||
for _conf in /etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/*; do
|
||||
[[ -f "$_conf" ]] || continue
|
||||
while read -r _sn; do
|
||||
@@ -289,7 +289,7 @@ fi
|
||||
_d="${_d%;}"
|
||||
[[ " ${_jsc_domain_seen[*]:-} " == *" $_d "* ]] && continue
|
||||
_jsc_domain_seen+=("$_d")
|
||||
local _d_escaped="${_d//./\\.}"
|
||||
_d_escaped="${_d//./\\.}"
|
||||
REFERER_ENTRIES+=" ~^1:https?://${_d_escaped} 1;\n"
|
||||
done
|
||||
done < <(grep -oP '^\s*server_name\s+\K[^;]+;?' "$_conf" 2>/dev/null)
|
||||
|
||||
Reference in New Issue
Block a user