raspiblitz/home.admin/80scanLND.sh

109 lines
2.8 KiB
Bash
Raw Normal View History

2019-02-02 23:49:04 +01:00
#!/bin/bash
2019-04-16 22:00:49 +01:00
source /home/admin/_version.info
2019-02-02 23:49:04 +01:00
source /home/admin/raspiblitz.info
2019-02-05 18:24:33 +01:00
source /mnt/hdd/raspiblitz.conf
2018-08-24 00:11:33 +02:00
2019-04-16 21:48:22 +01:00
source <(sudo /home/admin/config.scripts/blitz.statusscan.sh)
2019-04-16 22:07:59 +01:00
adminStr="ssh admin@${localIP} ->Password A"
if [ "$USER" == "admin" ]; then
adminStr="Use CTRL+c to EXIT to Terminal"
fi
2018-08-02 18:45:09 +02:00
2019-04-16 22:23:06 +01:00
if [ ${bitcoinActive} -eq 0 ]; then
####################
# On Bitcoin Error
####################
height=6
width=42
2019-04-16 22:58:59 +01:00
title="Blockchain Warning"
2019-04-16 23:02:21 +01:00
infoStr=" The ${network}d service is not running.\n Login for more details:"
2019-04-16 22:23:06 +01:00
if [ "$USER" == "admin" ]; then
2019-04-16 23:03:55 +01:00
echo ""
2019-04-16 23:09:38 +01:00
echo "*****************************************"
2019-04-16 23:03:55 +01:00
echo "* The ${network}d service is not running."
2019-04-16 23:09:38 +01:00
echo "*****************************************"
echo "If you just started some config/setup, this might be OK."
echo
if [ ${#bitcoinError} -gt 0 ]; then
echo "More Error Detail:"
echo ${bitcoinError}
echo
fi
echo "Use following command start ${network}d:"
echo "sudo systemctl start ${network}d"
echo
2019-04-16 23:03:55 +01:00
echo "Use following command to debug:"
echo "/home/admin/XXdebugLogs.sh"
echo ""
exit 1
2019-04-16 22:23:06 +01:00
fi
elif [ ${lndActive} -eq 0 ]; then
####################
# On LND Error
####################
2019-04-16 22:58:59 +01:00
height=5
2019-04-16 22:23:06 +01:00
width=42
2019-04-16 22:58:59 +01:00
title="Lightning Warning"
2019-04-16 23:02:21 +01:00
infoStr=" The lnd service is not running.\n Login for more details:"
2019-04-16 22:23:06 +01:00
if [ "$USER" == "admin" ]; then
2019-04-16 23:03:55 +01:00
echo ""
2019-04-16 22:58:59 +01:00
echo "*********************************"
2019-04-16 23:09:38 +01:00
echo "* The LND service is not running."
2019-04-16 22:58:59 +01:00
echo "*********************************"
2019-04-16 23:09:38 +01:00
echo "If you just started some config/setup, this might be OK."
echo
if [ ${#lndError} -gt 0 ]; then
echo "More Error Detail:"
echo ${lndError}
echo
fi
echo "Use following command start lnd:"
echo "sudo systemctl start lnd"
echo
2019-04-16 22:58:59 +01:00
echo "Use following command to debug:"
echo "/home/admin/XXdebugLogs.sh"
2019-04-16 23:03:55 +01:00
echo ""
2019-04-16 23:02:21 +01:00
exit 1
2019-04-16 22:23:06 +01:00
fi
else
####################
# Sync Progress
####################
# basic dialog info
height=6
width=42
2019-04-16 22:24:01 +01:00
title="Node is Syncing (${scriptRuntime})"
2019-04-16 22:23:06 +01:00
2019-04-16 23:15:41 +01:00
# formatting progress values
if [ ${#syncProgress} -eq 0 ]; then
syncProgress="(waiting)"
elif [ ${#syncProgress} -lt 6 ]; then
syncProgress=" ${syncProgress} %"
else
syncProgress="${syncProgress} %"
2019-04-16 22:23:06 +01:00
fi
2019-04-16 23:15:41 +01:00
if [ ${#scanProgress} -eq 0 ]; then
scanProgress="(waiting)"
elif [ ${#scanProgress} -lt 6 ]; then
scanProgress=" ${scanProgress} %"
else
scanProgress="${scanProgress} %"
2019-04-16 22:23:06 +01:00
fi
2019-04-16 23:15:41 +01:00
# setting info string
infoStr=" Blockchain Progress : ${syncProgress}\n Lightning Progress : ${scanProgress}\n Please wait - this can take some time"
2019-04-16 22:23:06 +01:00
fi
# display info to user
2019-04-16 22:08:55 +01:00
dialog --title " ${title} " --backtitle "RaspiBlitz ${codeVersion} ${hostname} / ${network} / ${chain} / ${tempCelsius}°C" --infobox "${infoStr}\n ${adminStr}" ${height} ${width}