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

View File

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

View File

@@ -558,7 +558,7 @@ if [ ${isMounted} -eq 0 ]; then
source ${setupFile} source ${setupFile}
if [ "${lightning}" == "lnd" ]; then if [ "${lightning}" == "lnd" ]; then
echo "Unlock LND at end of provision ..." >> $logFile 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 sleep 3
else else
echo "No lightning unlock (${lightning})" >> $logFile echo "No lightning unlock (${lightning})" >> $logFile

View File

@@ -303,7 +303,7 @@ if [ "${lightning}" == "lnd" ]; then
# make sure wallet is unlocked # make sure wallet is unlocked
sleep 3 sleep 3
/home/admin/config.scripts/lnd.unlock.sh "${passwordC}" >> ${logFile} /home/admin/config.scripts/lnd.unlock.sh unlock "${passwordC}" >> ${logFile}
sleep 3 sleep 3
# check if macaroon exists now - if not fail # check if macaroon exists now - if not fail
@@ -320,10 +320,10 @@ if [ "${lightning}" == "lnd" ]; then
# unlock Wallet (if needed) # unlock Wallet (if needed)
echo "*** Check Wallet Lock ***" >> ${logFile} 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) source <(/home/admin/config.scripts/lnd.unlock.sh status)
if [ ${locked} -gt 0 ]; then if [ "${locked}" != "0" ]; then
echo "OK - Wallet is locked ... starting unlocking dialog" >> ${logFile} 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 else
echo "OK - Wallet is already unlocked" >> ${logFile} echo "OK - Wallet is already unlocked" >> ${logFile}
fi fi

View File

@@ -47,7 +47,7 @@ Password C will be stored on the device.
sudo systemctl restart lnd sudo systemctl restart lnd
sleep 4 sleep 4
error="" 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 if [ "${error}" != "" ];then
echo "# PASSWORD C is wrong - try again or cancel" echo "# PASSWORD C is wrong - try again or cancel"
sleep 3 sleep 3