mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-26 19:47:05 +02:00
add status to lnd unlock
This commit is contained in:
@@ -588,16 +588,10 @@ if [ ${isMounted} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source ${infoFile}
|
source ${infoFile}
|
||||||
|
echo "WAIT LOOP: FINAL SETUP .. see controlFinalDialog.sh" >> $logFile
|
||||||
until [ "${state}" == "ready" ]
|
until [ "${state}" == "ready" ]
|
||||||
do
|
do
|
||||||
|
|
||||||
# TODO: DETECT WHEN USER SETUP IS DONE
|
|
||||||
echo "TODO: DETECT WHEN USER FINAL DIALOG IS DONE" >> $logFile
|
|
||||||
|
|
||||||
# offer option to COPY BLOCKHCAIN (see 50copyHDD.sh)
|
|
||||||
# handle possible errors
|
|
||||||
# show seed words
|
|
||||||
|
|
||||||
# get latest network info & update raspiblitz.info (in case network changes)
|
# get latest network info & update raspiblitz.info (in case network changes)
|
||||||
source <(/home/admin/config.scripts/internet.sh status)
|
source <(/home/admin/config.scripts/internet.sh status)
|
||||||
sed -i "s/^localip=.*/localip='${localip}'/g" ${infoFile}
|
sed -i "s/^localip=.*/localip='${localip}'/g" ${infoFile}
|
||||||
|
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
if [ "$1" == "-h" ] || [ "$1" == "help" ]; then
|
if [ "$1" == "-h" ] || [ "$1" == "help" ]; then
|
||||||
echo "script to unlock LND wallet"
|
echo "script to unlock LND wallet"
|
||||||
echo "lnd.unlock.sh [?passwordC]"
|
echo "lnd.unlock.sh status"
|
||||||
|
echo "lnd.unlock.sh unlock [?passwordC]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -10,13 +11,25 @@ fi
|
|||||||
source /home/admin/raspiblitz.info
|
source /home/admin/raspiblitz.info
|
||||||
source /mnt/hdd/raspiblitz.conf
|
source /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
# 1. parameter
|
# 1. parameter (default is unlock)
|
||||||
passwordC="$1"
|
action="$1"
|
||||||
|
|
||||||
|
# 2. parameter (optional password)
|
||||||
|
passwordC="$2"
|
||||||
|
|
||||||
# check if wallet is already unlocked
|
# check if wallet is already unlocked
|
||||||
echo "# checking LND wallet ... (can take some time)"
|
echo "# checking LND wallet ... (can take some time)"
|
||||||
walletLocked=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c unlock)
|
walletLocked=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c unlock)
|
||||||
macaroonsMissing=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c "unable to read macaroon")
|
macaroonsMissing=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c "unable to read macaroon")
|
||||||
|
|
||||||
|
# if action sis just status
|
||||||
|
if [ "${action}" == "status" ]; then
|
||||||
|
echo "locked=${walletLocked}"
|
||||||
|
echo "missingMacaroons=${macaroonsMissing}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if already unlocked all is done
|
||||||
if [ ${walletLocked} -eq 0 ] && [ ${macaroonsMissing} -eq 0 ]; then
|
if [ ${walletLocked} -eq 0 ] && [ ${macaroonsMissing} -eq 0 ]; then
|
||||||
echo "# OK LND wallet was already unlocked"
|
echo "# OK LND wallet was already unlocked"
|
||||||
exit 0
|
exit 0
|
||||||
|
Reference in New Issue
Block a user