diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 6073a20..f3e08f8 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -215,6 +215,10 @@ ln_channelInfo="\n" ln_external="\n" ln_alias="${hostname}" ln_publicColor="" +ln_port=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "^listen=*" | cut -f2 -d':') +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 @@ -227,7 +231,7 @@ else if [ ${ln_tor} -eq 1 ]; then ln_publicColor="${color_green}" else - public_check=$(nc -z -w6 ${public_ip} 9735 2>/dev/null; echo $?) + public_check=$(nc -z -w6 ${public_ip} ${ln_port} 2>/dev/null; echo $?) if [ $public_check = "0" ]; then # only set yellow/normal because netcat can only say that the port is open - not that it points to this device for sure ln_publicColor="${color_yellow}" diff --git a/home.admin/_bootstrap.provision.sh b/home.admin/_bootstrap.provision.sh index 7eb2c1e..77a344e 100644 --- a/home.admin/_bootstrap.provision.sh +++ b/home.admin/_bootstrap.provision.sh @@ -156,6 +156,20 @@ else echo "Provisioning TOR - keep default" >> ${logFile} fi +# CUSTOM PORT +echo "Provisioning LND Port" >> ${logFile} +lndPort=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "^listen=*" | cut -f2 -d':') +if [ ${#lndPort} -gt 0 ]; then + if [ "${lndPort}" != "9735" ]; then + echo "User is running custom LND port: ${lndPort}" >> ${logFile} + sudo /home/admin/config.scripts/lnd.setport.sh ${lndPort} >> ${logFile} 2>&1 + else + echo "User is running standard LND port: ${lndPort}" >> ${logFile} + fi +else + echo "Was not able to get LND port from config." >> ${logFile} +fi + sudo sed -i "s/^message=.*/message='Setup Done'/g" ${infoFile} echo "DONE - Give raspi some cool off time after hard building .... 20 secs sleep" >> ${logFile}