From 30c7db86c77790b2ba74cb600aa285a2cca7075e Mon Sep 17 00:00:00 2001 From: Benoit Perroud Date: Sun, 25 Feb 2024 16:39:26 +0100 Subject: [PATCH] Enable redirection on _latest.txt to eventually find the right file --- snapshot-loader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapshot-loader.sh b/snapshot-loader.sh index dd7e259..f6afb04 100755 --- a/snapshot-loader.sh +++ b/snapshot-loader.sh @@ -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)