mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 09:53:02 -04:00
Shellcheck
This commit is contained in:
+9
-5
@@ -190,7 +190,7 @@ curl_check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
write_debug() {
|
write_debug() {
|
||||||
local MSG=$@
|
local MSG=$*
|
||||||
if [[ ${DOCKER_MODS_DEBUG,,} = "true" ]]; then echo "[mod-init] (DEBUG) $MSG"; fi
|
if [[ ${DOCKER_MODS_DEBUG,,} = "true" ]]; then echo "[mod-init] (DEBUG) $MSG"; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,13 +233,17 @@ get_blob_sha() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_auth_url() {
|
get_auth_url() {
|
||||||
|
local auth_header
|
||||||
|
local realm_url
|
||||||
|
local service
|
||||||
|
local scope
|
||||||
# Call to get manifests and extract www-authenticate header
|
# Call to get manifests and extract www-authenticate header
|
||||||
local auth_header=$(curl -sLI ${CURL_NOISE_LEVEL} "${1}/${2}" | grep -i www-authenticate | tr -d '\r')
|
auth_header=$(curl -sLI ${CURL_NOISE_LEVEL} "${1}/${2}" | grep -i www-authenticate | tr -d '\r')
|
||||||
if [[ -n "${auth_header}" ]]; then
|
if [[ -n "${auth_header}" ]]; then
|
||||||
# Extract realm URL from www-authenticate header
|
# Extract realm URL from www-authenticate header
|
||||||
local realm_url=$(echo "$auth_header" | grep -oP 'realm="\K[^"]+')
|
realm_url=$(echo "$auth_header" | grep -oP 'realm="\K[^"]+')
|
||||||
local service=$(echo "$auth_header" | grep -oP 'service="\K[^"]+')
|
service=$(echo "$auth_header" | grep -oP 'service="\K[^"]+')
|
||||||
local scope=$(echo "$auth_header" | grep -oP 'scope="\K[^"]+')
|
scope=$(echo "$auth_header" | grep -oP 'scope="\K[^"]+')
|
||||||
echo "$realm_url?service=$service&scope=$scope"
|
echo "$realm_url?service=$service&scope=$scope"
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user