From 86619934d1b527b80b2b2e0011577dfc194987b9 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 Aug 2018 02:35:56 +0200 Subject: [PATCH] detect wallet locked during setup --- home.admin/10setupBlitz.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/home.admin/10setupBlitz.sh b/home.admin/10setupBlitz.sh index 8dfd945..1e63665 100755 --- a/home.admin/10setupBlitz.sh +++ b/home.admin/10setupBlitz.sh @@ -21,7 +21,12 @@ lndRunning=$(systemctl status lnd.service 2>/dev/null | grep -c running) if [ ${lndRunning} -eq 1 ]; then # check if LND is locked - locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | grep -c unlock) + walletExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/wallet.db 2>/dev/null | grep wallet.db -c) + locked=0 + # only when a wallet exists - it can be locked + if [ ${walletExists} -eq 1 ];then + locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | grep -c unlock) + fi if [ ${locked} -gt 0 ]; then # LND wallet is locked ./AAunlockLND.sh