Skip to content

Commit

Permalink
Use status code greater than 200
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBenson committed Aug 8, 2024
1 parent d498e5a commit 0fd3dfc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/cnode-helper-scripts/mithril.library
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ set_node_minimum_version() {
response_file=$(mktemp)
status_code=$(curl -s -o "$response_file" -w "%{http_code}" https://raw.githubusercontent.com/input-output-hk/mithril/${MITHRIL_LATEST_VERSION}/networks.json)

if [[ "$status_code" -ge 400 ]]; then
NODE_MINIMUM_VERSION=""
else
NODE_MINIMUM_VERSION=$(jq -r ".${NETWORK_NAME,,}.\"cardano-minimum-version\".\"mithril-signer\"" "$response_file")
if [[ "${status_code}" -gt 200 ]]; then
echo "ERROR: Failed to download the networks.json file from the mithril repository! curl status code: ${status_code}."
elif [[ "${status_code}" -eq 200 ]]; then
NETWORK=${NETWORK_NAME,,}
NETWORK=${NETWORK:-mainnet}
MITHRIL_MINIMUM_NODE_VERSION=$(jq -r ".${NETWORK}.\"cardano-minimum-version\".\"mithril-signer\"" "$response_file")
fi
rm -f "$response_file"
}
Expand Down

0 comments on commit 0fd3dfc

Please sign in to comment.