Skip to content

Commit

Permalink
Enable redirection on _latest.txt to eventually find the right file
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwhile committed Feb 25, 2024
1 parent 1ff4970 commit 30c7db8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snapshot-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ then

# Check if enough disk space available
availableSpace=$(df -B1 "$ALEPHIUM_HOME" | tail -n 1 | awk '{print $4}' | head -n 1)
neededSpace=$(curl -s -I -L "$(curl -s https://archives.alephium.org/archives/$ALEPHIUM_NETWORK/full-node-data/_latest.txt)" | grep Content-Length | awk '{print $2}' | tr -d '\r')
neededSpace=$(curl -s -I -L "$(curl -sL https://archives.alephium.org/archives/$ALEPHIUM_NETWORK/full-node-data/_latest.txt)" | grep -i 'Content-Length:' | awk '{print $2}' | tr -d '\r')
neededSpaceWithMargin=$(echo "${neededSpace} * 1.2 / 1" | bc)
neededSpaceInGB=$(echo "${neededSpaceWithMargin} / 1000 / 1000 / 1000 / 1" | bc)
availableSpaceInGB=$(echo "${availableSpace} / 1000 / 1000 / 1000 / 1" | bc)
Expand Down

0 comments on commit 30c7db8

Please sign in to comment.