diff --git a/home.admin/00raspiblitz.sh b/home.admin/00raspiblitz.sh index d601b46b2..ad10088dc 100755 --- a/home.admin/00raspiblitz.sh +++ b/home.admin/00raspiblitz.sh @@ -142,7 +142,7 @@ do fi # CLN Wallet Unlock - if [ "${clnActive}" == "1" ] && [ "${CLNwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then + if [ "${CLNwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then /home/admin/config.scripts/cln.hsmtool.sh unlock sleep 5 fi diff --git a/home.admin/config.scripts/blitz.statusscan.sh b/home.admin/config.scripts/blitz.statusscan.sh index 7f1b80f38..38e9c1837 100755 --- a/home.admin/config.scripts/blitz.statusscan.sh +++ b/home.admin/config.scripts/blitz.statusscan.sh @@ -277,14 +277,11 @@ if [ ${lndRunning} -eq 1 ] && [ "${LNTYPE}" == "lnd" ]; then fi # is CLN running -clnStatus=$(systemctl status ${netprefix}lightningd.service 2>/dev/null) -clnRunning=$(echo "${clnStatus}" | grep -c running) +clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running) echo "clnActive=${clnRunning}" -clnRestarting=$(echo "${clnStatus}" | grep -c "activating (auto-restart)") -echo "clnRestarting=${clnRestarting}" -if [ "${clnRestarting}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then +echo "CLNwalletLocked=0" +if [ "${clnRunning}" != "1" ] && [ "${LNTYPE}" == "cln" ]; then clnInfo=$($lightningcli_alias getinfo 2>&1) - # check if locked if [ $(echo "${clnInfo}" | grep -c "Connecting to 'lightning-rpc': Connection refused") -gt 0 ];then echo "# CLN wallet not running yet" @@ -293,11 +290,10 @@ if [ "${clnRestarting}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then || [ $(echo "${clnError}" | grep -c 'hsm_secret is encrypted, you need to pass the --encrypted-hsm startup option.') -gt 0 ]\ || [ $(echo "${clnError}" | grep -c 'Wrong password for encrypted hsm_secret.') -gt 0 ]; then echo "CLNwalletLocked=1" - else - echo "CLNwalletLocked=0" fi fi fi + if [ "${clnRunning}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then clnInfo=$($lightningcli_alias getinfo) clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]') diff --git a/home.admin/config.scripts/cln.hsmtool.sh b/home.admin/config.scripts/cln.hsmtool.sh index d54cb8759..eedb509e9 100644 --- a/home.admin/config.scripts/cln.hsmtool.sh +++ b/home.admin/config.scripts/cln.hsmtool.sh @@ -280,7 +280,7 @@ elif [ "$1" = "unlock" ]; then exit 1 fi echo "# Waiting to unlock wallet ... " - sleep 5 + sleep 15 attempt=$((attempt+1)) done echo "# Ok the ${netprefix}lightningd wallet is unlocked"