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 <lakshay.singh1108@gmail.com>
This commit is contained in:
parent
2b597bb3c6
commit
c88dd5fd27
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user