From 95137a647721b57ca05fa9008963ae0cf89cf01e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 26 Jan 2020 21:24:05 +0100 Subject: [PATCH] #123 adding ElectrumRS to XXdebugLogs.sh --- home.admin/XXdebugLogs.sh | 15 +++++- home.admin/config.scripts/bonus.electrs.sh | 55 ++++++++++++++++++++-- 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/home.admin/XXdebugLogs.sh b/home.admin/XXdebugLogs.sh index 69883001a..9abd72aa5 100644 --- a/home.admin/XXdebugLogs.sh +++ b/home.admin/XXdebugLogs.sh @@ -87,7 +87,7 @@ if [ "${loop}" = "on" ]; then sudo journalctl -u loopd -b --no-pager -n20 echo "" else - echo "- RTL is OFF by config" + echo "- Loop is OFF by config" echo "" fi @@ -101,6 +101,19 @@ else echo "" fi +if [ "${ElectRS}" = "on" ]; then + echo "*** LAST 20 ElectRS LOGS ***" + echo "sudo journalctl -u electrs -b --no-pager -n20" + sudo journalctl -u electrs -b --no-pager -n20 + echo "" + echo "*** ElectRS Status ***" + sudo /home/admin/config.scripts/bonus.electrs.sh status + echo "" +else + echo "- Electrum Rust Server is OFF by config" + echo "" +fi + echo "*** HARDWARE TEST RESULTS ***" showImproveInfo=0 if [ ${#undervoltageReports} -gt 0 ]; then diff --git a/home.admin/config.scripts/bonus.electrs.sh b/home.admin/config.scripts/bonus.electrs.sh index f4e3de2d0..e9847d4ba 100644 --- a/home.admin/config.scripts/bonus.electrs.sh +++ b/home.admin/config.scripts/bonus.electrs.sh @@ -86,22 +86,67 @@ if [ "$1" = "menu" ]; then # get status source <(sudo /home/admin/config.scripts/bonus.electrs.sh status) + if [ ${serviceInstalled} -eq 0 ]; then + echo "# FAIL not installed" + exit 1 + fi + + if [ ${serviceRunning} -eq 0 ]; then + dialog --title "Electrum Service Not Running" --msgbox " +The electrum system service is not running. +Please check the following debug info. + " 8 48 + /home/admin/XXdebugInfo.sh + echo "Press ENTER to get back to main menu." + read key + exit 0 + fi + + if [ ${isSynced} -eq 0 ]; then + dialog --title "Electrum Index Not Ready" --msgbox " +Electrum server is still building its index. +Please wait and try again later. +This can take multiple hours. + " 9 48 + exit 0 + fi + # Options (available without TOR) OPTIONS=( \ - CONNECT "Connect" \ - STATUS "Status" + CONNECT "How to Connect" \ + INDEX "Delete/Rebuild Index" \ + STATUS "Debug Status Info" ) - CHOICE=$(whiptail --clear --title "Choose Mobile Wallet" --menu "" 13 50 7 "${OPTIONS[@]}" 2>&1 >/dev/tty) + CHOICE=$(whiptail --clear --title "Electrum Rust Server" --menu "menu" 8 50 7 "${OPTIONS[@]}" 2>&1 >/dev/tty) clear case $CHOICE in CONNECT) - echo "connect" + echo "######## How to Connect to Electrum Rust Server #######" + + echo + echo "Press ENTER to get back to main menu." read key ;; STATUS) - echo "status" + echo "######## Electrum Rust Server Debug Info ########" + sudo /home/admin/config.scripts/bonus.electrs.sh status + echo + echo "Press ENTER to get back to main menu." + read key + ;; + INDEX) + echo "######## Delete/Rebuild Index ########" + echo "# stopping service" + sudo systemctl stop electrs + echo "# deleting index" + sudo rm -r /mnt/hdd/app-storage/electrs/db + echo "# starting service" + sudo systemctl start electrs + echo "# ok" + echo + echo "Press ENTER to get back to main menu." read key ;; esac