This commit is contained in:
squidbear
2025-04-01 07:54:24 +02:00
parent abd303aba8
commit fcdb322d2f

View File

@@ -94,10 +94,10 @@ for part in "${parts[@]}"; do
# Run envsubst to replace environment variables in the input file and save the result to the output file
if yaml2json < "$BASEPATH/$part" | jq -e '.upstreams' >/dev/null 2>&1; then
echo "upstreams key exists in $part"
#echo "upstreams key exists in $part"
upstreams+=("$(yaml2json < "$BASEPATH/$part" | jq '.upstreams' | json2yaml | sed 's/^/ /' | envsubst)")
else
echo "upstreams config $input_file for $part"
#echo "upstreams config $input_file for $part"
upstreams+=("$(envsubst < "$input_file")")
fi