From 6f788591cf682b15e1d027c4dc73091ff903db14 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 15:51:50 +0100 Subject: [PATCH] press x to stop monitoring --- home.admin/config.scripts/network.reindex.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 3bbc7be..3646eac 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -48,11 +48,20 @@ while [ ${finished} -eq 0 ] echo "REINDEXING BLOCKCHAIN" echo "*************************" echo "THIS CAN TAKE SOME LONG TIME" - echo "If you dont see any progress after 24h press X to stop." + echo "If you dont see any progress after 24h keep X pressed to stop." #TODO: detect and display progress #TODO: determine when finished and then finished=1 + # wait 2 seconds for key input + read -n 1 -t 2 keyPressed + + # check if user wants to abort monitor + if [ "${keyPressed}" = "x" ]; then + echo "stopped by user ..." + break + fi + done # trigger reboot when finished