raspiblitz/home.admin/AAunlockLND.sh

28 lines
1020 B
Bash
Raw Normal View History

2018-07-17 13:12:03 +02:00
#!/bin/sh
2018-07-29 01:33:54 +02:00
# load network
2018-07-29 21:43:16 +02:00
network=`cat .network`
2018-07-29 01:33:54 +02:00
2018-07-17 13:12:03 +02:00
echo ""
echo "****************************************************************************"
2018-08-27 11:08:04 +02:00
echo "Unlock LND Wallet --> lncli --chain=${network} unlock"
2018-07-17 13:12:03 +02:00
echo "****************************************************************************"
echo "HELP: Enter your PASSWORD C"
2018-09-04 02:15:12 +02:00
echo "You may wait some seconds until you get asked for password."
2018-07-17 13:12:03 +02:00
echo "****************************************************************************"
while :
do
2018-08-09 10:48:51 +02:00
chain="$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')"
2018-08-27 11:08:04 +02:00
sudo -u bitcoin /usr/local/bin/lncli --chain=${network} unlock
2018-07-17 13:12:03 +02:00
sleep 4
2018-07-29 01:33:54 +02:00
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c unlock)
2018-07-17 13:12:03 +02:00
if [ ${locked} -eq 0 ]; then
break
fi
echo ""
2018-08-09 02:33:47 +02:00
echo "network(${network}) chain(${chain})"
sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log
2018-07-17 13:12:03 +02:00
echo "Wallet still locked - please try again or Cancel with CTRL+C"
done