raspiblitz/home.admin/AAunlockLND.sh

36 lines
1.3 KiB
Bash
Raw Normal View History

2018-12-05 00:07:58 +01:00
#!/bin/bash
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)
2019-02-02 23:49:04 +01:00
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
2018-12-04 00:51:17 +01:00
if [ ${#network} -eq 0 ]; then network=`cat .network`; fi
2019-01-24 18:27:34 +01:00
if [ ${#network} -eq 0 ]; then network="bitcoin"; fi
2018-12-04 00:51:17 +01:00
if [ ${#chain} -eq 0 ]; then
2018-12-04 22:24:28 +01:00
echo "gathering chain info ... please wait"
2018-12-04 00:51:17 +01:00
chain=$(${network}-cli getblockchaininfo | jq -r '.chain')
fi
2018-07-29 01:33:54 +02:00
2018-12-04 22:24:28 +01:00
clear
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-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
2019-05-09 20:06:43 +02:00
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | 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
2019-05-28 01:39:04 +02:00
echo "Wallet still locked - please try again or"
echo "Cancel with CTRL+C - back to setup with command: raspiblitz"
2018-07-17 13:12:03 +02:00
done