From 54ab4796358d50356bbe6c901ca231c9b6f9e620 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Wed, 13 Jan 2021 15:11:30 +0000 Subject: [PATCH] mempool: start only if the setup is ready (#1944) --- home.admin/00settingsMenuServices.sh | 2 +- home.admin/config.scripts/bonus.mempool.sh | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index be403878..01f0f0d8 100755 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -423,7 +423,7 @@ if [ "${mempoolExplorer}" != "${choice}" ]; then errorOnInstall=$? if [ "${choice}" = "on" ]; then if [ ${errorOnInstall} -eq 0 ]; then - sudo sytemctl start mempool + sudo systemctl start mempool whiptail --title " Installed Mempool Space " --msgbox "\ The txindex may need to be created before Mempool can be active.\n This can take ~7 hours on a RPi4 with SSD. Monitor the progress on the LCD.\n diff --git a/home.admin/config.scripts/bonus.mempool.sh b/home.admin/config.scripts/bonus.mempool.sh index c7501b6e..0cc69a30 100755 --- a/home.admin/config.scripts/bonus.mempool.sh +++ b/home.admin/config.scripts/bonus.mempool.sh @@ -2,11 +2,14 @@ # https://github.com/mempool/mempool +pinnedVersion="v2.0.1" + # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "# small config script to switch Mempool on or off" - echo "# bonus.mempool.sh [status|on|off]" - exit 1 + echo "# small config script to switch Mempool on or off" + echo "# installs the $pinnedVersion by default" + echo "# bonus.mempool.sh [status|on|off]" + exit 1 fi source /mnt/hdd/raspiblitz.conf @@ -116,7 +119,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then cd /home/mempool sudo -u mempool git clone https://github.com/mempool/mempool.git cd mempool - sudo -u mempool git reset --hard v2.0.1 + sudo -u mempool git reset --hard $pinnedVersion # modify an #echo "# try to suppress question on statistics report .." @@ -258,7 +261,14 @@ EOF echo "# mempool already installed." fi - sudo systemctl start mempool + # start the service if ready + source /home/admin/raspiblitz.info + if [ "${state}" == "ready" ]; then + echo "# OK - the mempool.service is enabled, system is on ready so starting service" + sudo systemctl start mempool + else + echo "# OK - the mempool.service is enabled, to start manually use: sudo systemctl start mempool" + fi # setting value in raspi blitz config sudo sed -i "s/^mempoolExplorer=.*/mempoolExplorer=on/g" /mnt/hdd/raspiblitz.conf