fix lndunlock for macaroon reset

This commit is contained in:
rootzoll 2020-08-02 22:25:22 +02:00
parent 738d50f2ab
commit 5cdd7e5370

View File

@ -15,12 +15,12 @@ passwordC="$1"
# check if wallet is already unlocked
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)
if [ ${walletLocked} -eq 0 ]; then
macaroonsMissing=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c "unable to read macaroon")
if [ ${walletLocked} -eq 0 ] && [ ${macaroonsMissing} -eq 0 ]; then
echo "# OK LND wallet was already unlocked"
exit 0
fi
# check if LND is below 0.10 (has no STDIN password option)
fallback=0
source <(/home/admin/config.scripts/lnd.update.sh info)