From 6283e3fa1aa55c3c33aa9a26568523f047a2c9f7 Mon Sep 17 00:00:00 2001 From: squidbear <379651+czarly@users.noreply.github.com> Date: Tue, 1 Apr 2025 07:06:58 +0200 Subject: [PATCH] fix --- tron-mainnet.yml | 1 - upstreams.sh | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) delete mode 120000 tron-mainnet.yml diff --git a/tron-mainnet.yml b/tron-mainnet.yml deleted file mode 120000 index 1ae0df98..00000000 --- a/tron-mainnet.yml +++ /dev/null @@ -1 +0,0 @@ -tron/java-tron/tron-mainnet-java-tron-pruned-rocksdb.yml \ No newline at end of file diff --git a/upstreams.sh b/upstreams.sh index 4d719eeb..ef3368cc 100755 --- a/upstreams.sh +++ b/upstreams.sh @@ -135,9 +135,16 @@ while IFS= read -r url; do #echo "$input_file" [ -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 - upstreams+=("$(envsubst < "$input_file")") + + # Run envsubst to replace environment variables in the input file and save the result to the output 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 fi