fix
This commit is contained in:
@@ -93,9 +93,9 @@ for part in "${parts[@]}"; do
|
|||||||
[ -f "$input_file" ] || input_file="$BASEPATH/default.cfg"
|
[ -f "$input_file" ] || input_file="$BASEPATH/default.cfg"
|
||||||
|
|
||||||
# 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 < tron-mainnet.yml | jq -e '.upstreams' >/dev/null 2>&1; then
|
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 < tron-mainnet.yml | jq '.upstreams' | sed 's/^/ /' | envsubst | json2yaml))
|
upstreams+=($(yaml2json < "$BASEPATH/$part" | jq '.upstreams' | sed 's/^/ /' | envsubst | json2yaml))
|
||||||
else
|
else
|
||||||
echo "upstreams config $input_file for $part"
|
echo "upstreams config $input_file for $part"
|
||||||
upstreams+=("$(envsubst < "$input_file")")
|
upstreams+=("$(envsubst < "$input_file")")
|
||||||
|
|||||||
Reference in New Issue
Block a user