Add startup grace time

This commit is contained in:
Christian Rotzoll
2019-04-16 23:34:53 +01:00
parent a481c134db
commit b6dd3953a6
2 changed files with 54 additions and 36 deletions

View File

@@ -20,6 +20,7 @@ if [ ${bitcoinActive} -eq 0 ]; then
height=6 height=6
width=42 width=42
title="Blockchain Info" title="Blockchain Info"
if [ ${uptime} -gt 300 ]; then
infoStr=" The ${network}d service is not running.\n Login for more details:" infoStr=" The ${network}d service is not running.\n Login for more details:"
if [ "$USER" == "admin" ]; then if [ "$USER" == "admin" ]; then
echo "" echo ""
@@ -41,6 +42,12 @@ if [ ${bitcoinActive} -eq 0 ]; then
echo "" echo ""
exit 1 exit 1
fi fi
else
infoStr=" The ${network}d service is starting.\n Login for more details:"
if [ "$USER" == "admin" ]; then
infoStr=" The ${network}d service is starting.\n Please wait up to 5min ..."
fi
fi
elif [ ${lndActive} -eq 0 ]; then elif [ ${lndActive} -eq 0 ]; then
@@ -51,7 +58,8 @@ elif [ ${lndActive} -eq 0 ]; then
height=5 height=5
width=42 width=42
title="Lightning Info" title="Lightning Info"
infoStr=" The lnd service is not running.\n Login for more details:" if [ ${uptime} -gt 300 ]; then
infoStr=" The LND service is not running.\n Login for more details:"
if [ "$USER" == "admin" ]; then if [ "$USER" == "admin" ]; then
echo "" echo ""
echo "*********************************" echo "*********************************"
@@ -72,6 +80,12 @@ elif [ ${lndActive} -eq 0 ]; then
echo "" echo ""
exit 1 exit 1
fi 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 ..."
fi
fi
else else

View File

@@ -24,6 +24,10 @@ echo "localIP='${localip}'"
tempC=$(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc) tempC=$(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc)
echo "tempCelsius='${tempC}'" echo "tempCelsius='${tempC}'"
# uptime in seconds
uptime=$(awk '{printf("%d\n",$1 + 0.5)}' /proc/uptime)
echo "uptime=${uptime}"
# is bitcoind running # is bitcoind running
bitcoinRunning=$(systemctl status ${network}d.service 2>/dev/null | grep -c running) bitcoinRunning=$(systemctl status ${network}d.service 2>/dev/null | grep -c running)
echo "bitcoinActive=${bitcoinRunning}" echo "bitcoinActive=${bitcoinRunning}"