Update run_include to only set $HEALTHCHECKSURL when both subvariables are set.

This commit is contained in:
Aterfax 2025-03-24 14:33:17 +00:00 committed by GitHub
parent c6d06fa760
commit 7060d5c4e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,8 +30,11 @@ if [ -z "$PBS_PASSWORD" ]; then
exit 1
fi
HEALTHCHECKSURL="${HEALTHCHECKSHOSTNAME}/ping/${HEALTHCHECKSUUID}"
# Evaluate each subvariable and replace all spaces with nothing - if not zero length set variable.
if [[ ! -z "${HEALTHCHECKSHOSTNAME// }" ]] && [[ ! -z "${HEALTHCHECKSUUID// }" ]]; then
HEALTHCHECKSURL="${HEALTHCHECKSHOSTNAME}/ping/${HEALTHCHECKSUUID}"
export HEALTHCHECKSURL="${HEALTHCHECKSURL}"
fi
export HEALTHCHECKSURL="${HEALTHCHECKSURL}"
export PBS_PASSWORD="${PBS_PASSWORD}"
export PBS_REPOSITORY="${PBS_USER}@${PBS_ENDPOINT}:${PBS_DATASTORE}"
export PBS_REPOSITORY="${PBS_USER}@${PBS_ENDPOINT}:${PBS_DATASTORE}"