This commit is contained in:
squidbear
2025-04-01 07:06:58 +02:00
parent 6ec304e4d6
commit 6283e3fa1a
2 changed files with 10 additions and 4 deletions

View File

@@ -1 +0,0 @@
tron/java-tron/tron-mainnet-java-tron-pruned-rocksdb.yml

View File

@@ -135,9 +135,16 @@ while IFS= read -r url; do
#echo "$input_file" #echo "$input_file"
[ -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
upstreams+=("$(envsubst < "$input_file")") if yq e '.upstreams' tron-mainnet.yml >/dev/null 2>&1; then
echo "upstreams key exists"
upstreams+=(yq e '.upstreams' tron-mainnet.yml | sed 's/^/ /' | envsubst)
else
upstreams+=("$(envsubst < "$input_file")")
echo "upstreams key does not exist"
fi
done < $BASEPATH/external-rpcs.txt done < $BASEPATH/external-rpcs.txt
fi fi