raspiblitz/home.admin/80scanLND.sh

120 lines
3.5 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
####################
2019-04-16 23:38:59 +01:00
height=5
2019-04-16 22:23:06 +01:00
width=42
2019-04-16 23:16:49 +01:00
title="Blockchain Info"
2019-04-16 23:34:53 +01:00
if [ ${uptime} -gt 300 ]; then
infoStr=" The ${network}d service is not running.\n Login for more details:"
if [ "$USER" == "admin" ]; then
echo ""
echo "*****************************************"
echo "* The ${network}d service is not running."
echo "*****************************************"
echo "If you just started some config/setup, this might be OK."
2019-04-16 23:09:38 +01:00
echo
2019-04-17 00:03:36 +01:00
if [ ${#bitcoinErrorFull} -gt 0 ]; then
2019-04-16 23:34:53 +01:00
echo "More Error Detail:"
2019-04-17 00:03:36 +01:00
echo ${bitcoinErrorFull}
2019-04-16 23:34:53 +01:00
echo
fi
2019-04-16 23:44:55 +01:00
echo "-> To start ${network}d run: sudo systemctl start ${network}d"
2019-04-16 23:47:45 +01:00
echo "-> To force Main Menu run: /home/admin/00mainMenu.sh"
2019-04-16 23:44:55 +01:00
echo "-> Use following command to debug: /home/admin/XXdebugLogs.sh"
2019-04-16 23:34:53 +01:00
echo ""
exit 1
fi
else
2019-04-17 00:03:36 +01:00
height=6
infoStr=" The ${network}d service is starting.\n${bitcoinErrorShort}\n Login for more details:"
2019-04-16 23:34:53 +01:00
if [ "$USER" == "admin" ]; then
2019-04-17 00:03:36 +01:00
infoStr=" The ${network}d service is starting.\n${bitcoinErrorShort}\nPlease wait up to 5min ..."
2019-04-16 23:09:38 +01:00
fi
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 23:16:49 +01:00
title="Lightning Info"
2019-04-16 23:34:53 +01:00
if [ ${uptime} -gt 300 ]; then
infoStr=" The LND service is not running.\n Login for more details:"
if [ "$USER" == "admin" ]; then
echo ""
echo "*********************************"
echo "* The LND service is not running."
echo "*********************************"
echo "If you just started some config/setup, this might be OK."
2019-04-16 23:09:38 +01:00
echo
2019-04-17 00:03:36 +01:00
if [ ${#lndErrorFull} -gt 0 ]; then
2019-04-16 23:34:53 +01:00
echo "More Error Detail:"
2019-04-17 00:03:36 +01:00
echo ${lndErrorFull}
2019-04-16 23:34:53 +01:00
echo
fi
2019-04-16 23:44:55 +01:00
echo "-> To start LND run: sudo systemctl start lnd"
2019-04-16 23:47:45 +01:00
echo "-> To force Main Menu run: /home/admin/00mainMenu.sh"
2019-04-16 23:44:55 +01:00
echo "-> Use following command to debug: /home/admin/XXdebugLogs.sh"
2019-04-16 23:34:53 +01:00
echo ""
exit 1
fi
else
infoStr=" The LND service is starting.\n Login for more details:"
if [ "$USER" == "admin" ]; then
infoStr=" The LND service is starting.\n Please wait up to 5min ..."
2019-04-16 23:09:38 +01:00
fi
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
2019-04-16 23:18:18 +01:00
syncProgress="waiting"
2019-04-16 23:15:41 +01:00
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
2019-04-16 23:18:18 +01:00
scanProgress="waiting"
2019-04-16 23:15:41 +01:00
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}