update lnd unlock script

This commit is contained in:
rootzoll 2021-07-03 00:05:01 +02:00
parent 11d17f7d92
commit c070e421b1
5 changed files with 10 additions and 10 deletions

View file

@ -233,8 +233,8 @@ if [ ${#ln_port} -eq 0 ]; then
ln_port="9735"
fi
wallet_unlocked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2> /dev/null | grep -c unlock)
if [ "$wallet_unlocked" -gt 0 ] ; then
source <(/home/admin/config.scripts/lnd.unlock.sh status)
if [ "${locked}" != "0" ] ; then
alias_color="${color_red}"
ln_alias="Wallet Locked"
else

View file

@ -400,8 +400,8 @@ do
if [ "${autoUnlock}" = "on" ]; then
# check if lnd is locked
locked=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>&1 | grep -c unlock)
if [ ${locked} -gt 0 ]; then
source <(/home/admin/config.scripts/lnd.unlock.sh status)
if [ "${locked}" != "0" ]; then
echo "STARTING AUTO-UNLOCK ..."
sudo /home/admin/config.scripts/lnd.unlock.sh

View file

@ -558,7 +558,7 @@ if [ ${isMounted} -eq 0 ]; then
source ${setupFile}
if [ "${lightning}" == "lnd" ]; then
echo "Unlock LND at end of provision ..." >> $logFile
/home/admin/config.scripts/lnd.unlock.sh "${passwordC}" >> ${logFile}
/home/admin/config.scripts/lnd.unlock.sh unlock "${passwordC}" >> ${logFile}
sleep 3
else
echo "No lightning unlock (${lightning})" >> $logFile

View file

@ -303,7 +303,7 @@ if [ "${lightning}" == "lnd" ]; then
# make sure wallet is unlocked
sleep 3
/home/admin/config.scripts/lnd.unlock.sh "${passwordC}" >> ${logFile}
/home/admin/config.scripts/lnd.unlock.sh unlock "${passwordC}" >> ${logFile}
sleep 3
# check if macaroon exists now - if not fail
@ -320,10 +320,10 @@ if [ "${lightning}" == "lnd" ]; then
# unlock Wallet (if needed)
echo "*** Check Wallet Lock ***" >> ${logFile}
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | grep -c unlock)
if [ ${locked} -gt 0 ]; then
source <(/home/admin/config.scripts/lnd.unlock.sh status)
if [ "${locked}" != "0" ]; then
echo "OK - Wallet is locked ... starting unlocking dialog" >> ${logFile}
/home/admin/config.scripts/lnd.unlock.sh "${passwordC}" >> ${logFile}
/home/admin/config.scripts/lnd.unlock.sh unlock "${passwordC}" >> ${logFile}
else
echo "OK - Wallet is already unlocked" >> ${logFile}
fi

View file

@ -47,7 +47,7 @@ Password C will be stored on the device.
sudo systemctl restart lnd
sleep 4
error=""
source <(sudo /home/admin/config.scripts/lnd.unlock.sh "$passwordC")
source <(sudo /home/admin/config.scripts/lnd.unlock.sh unlock "$passwordC")
if [ "${error}" != "" ];then
echo "# PASSWORD C is wrong - try again or cancel"
sleep 3