From c88dd5fd27cf9dd7a6cf3c328b8e23f384e7557d Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 30 Jan 2024 22:15:34 +0530 Subject: [PATCH] txoo: healthcheck fix latest file retrieval ls -r1t doesn't get latest time sorted file r with t reverses things to get oldest one instead use just r as time of file generation might not be sequential Signed-off-by: Lakshya Singh --- txood/healthcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/txood/healthcheck.sh b/txood/healthcheck.sh index 4b04c8e..e028135 100755 --- a/txood/healthcheck.sh +++ b/txood/healthcheck.sh @@ -4,7 +4,7 @@ set -ex # Get the latest file with extension .sa from /root/.txoo/$BITCOIN_NETWORK/public directory and get the block number from the file name TXOO_LOCATION=/root/.txoo/$BITCOIN_NETWORK/public -latest_block=$(ls -r1t $TXOO_LOCATION | grep '.sa' | head -n1 | cut -d'-' -f1) +latest_block=$(ls -r1 $TXOO_LOCATION | grep '.sa' | head -n1 | cut -d'-' -f1) # Check if no file was found if [ -z "$latest_block" ]; then