mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-23 14:40:45 +01:00
3460 Mempool install check fix (#3528)
* fix mempool working detection * #3640 change test * add version info for electrs
This commit is contained in:
parent
5a08729644
commit
f067250979
2 changed files with 16 additions and 13 deletions
|
@ -29,6 +29,8 @@ if [ "$1" = "status" ]; then
|
|||
|
||||
echo "##### STATUS ELECTRS SERVICE"
|
||||
|
||||
echo "version='${ELECTRSVERSION}'"
|
||||
|
||||
if [ "${ElectRS}" = "on" ]; then
|
||||
echo "configured=1"
|
||||
else
|
||||
|
|
|
@ -337,6 +337,16 @@ EOF
|
|||
if [ "${state}" == "ready" ]; then
|
||||
echo "# OK - the mempool.service is enabled, system is on ready so starting service"
|
||||
sudo systemctl start mempool
|
||||
sleep 10
|
||||
|
||||
# check install success by testing backend
|
||||
isWorking=$(sudo systemctl status mempool | grep -c "Active: active")
|
||||
if [ ${isWorking} -lt 1 ]; then
|
||||
# signal an error to WebUI
|
||||
echo "result='mempool service not active'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
echo "# OK - the mempool.service is enabled, to start manually use: sudo systemctl start mempool"
|
||||
fi
|
||||
|
@ -353,19 +363,10 @@ EOF
|
|||
/home/admin/config.scripts/tor.onion-service.sh mempool 80 4082 443 4083
|
||||
fi
|
||||
|
||||
# check install success by testing backend
|
||||
localIP=$(hostname -I | awk '{print $1}')
|
||||
httpResponseCode=$(curl -s -o /dev/null -w "%{http_code}" http://${localIP}:4080/api/v1/statistics/2h)
|
||||
if [ "${httpResponseCode}" != "200" ]; then
|
||||
# signal an error to WebUI
|
||||
echo "result='${httpResponseCode}'"
|
||||
echo "# HTTP error code ${httpResponseCode} calling backend: http://${localIP}:4080/api/v1/statistics/2h"
|
||||
exit 1
|
||||
else
|
||||
# needed for API/WebUI as signal that install ran thru
|
||||
echo "result='OK'"
|
||||
exit 0
|
||||
fi
|
||||
# needed for API/WebUI as signal that install ran thru
|
||||
echo "result='OK'"
|
||||
exit 0
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue