This commit is contained in:
squidbear
2025-04-01 12:56:44 +02:00
parent 57434f06a6
commit e2f9b2f634

View File

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