raspiblitz/home.admin/AAunlockLND.sh

32 lines
1.2 KiB
Bash
Raw Normal View History

2018-07-17 13:12:03 +02:00
#!/bin/sh
2018-07-29 01:33:54 +02:00
2018-12-04 00:51:17 +01:00
# load raspiblitz config data (with backup from old config)
source /mnt/hdd/raspiblitz.conf 2>/dev/null
if [ ${#network} -eq 0 ]; then network=`cat .network`; fi
if [ ${#chain} -eq 0 ]; then
chain=$(${network}-cli getblockchaininfo | jq -r '.chain')
fi
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