This commit is contained in:
Sebastian
2024-04-05 11:10:04 +02:00
parent 8afe4606fc
commit df992a70ea

View File

@@ -31,12 +31,12 @@ for path in $pathlist; do
latest_block_timestamp=$(echo "$response" | jq -r '.result.timestamp') latest_block_timestamp=$(echo "$response" | jq -r '.result.timestamp')
current_timestamp=$(date +%s) current_timestamp=$(date +%s)
age=$((current_timestamp - ("16#${latest_block_timestamp#0x}"))) age=$((current_timestamp - ("16#${latest_block_timestamp#0x}")))
echo "$age"
if (( age < ${2:-3600} )); then if (( age < ${2:-3600} )); then
echo "Block is less than ${2:-3600} seconds old. Age: $age seconds"
exit 0 exit 0
else else
echo "Block is older than ${2:-3600} seconds. Age: $age seconds"
exit 1 exit 1
fi fi
fi fi