From d1c83f5a05cf6cdde6702a99e19b925db6e05ea6 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 27 Jan 2020 23:55:12 +0100 Subject: [PATCH] #123 option to keep index on uninstall --- home.admin/00settingsMenuServices.sh | 12 +++++++++++- home.admin/97addMobileWallet.sh | 8 ++++---- home.admin/config.scripts/bonus.electrs.sh | 6 +----- home.admin/config.scripts/bonus.lndconnect.sh | 4 ++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 035fb2fc3..c7b250ff8 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -417,7 +417,17 @@ if [ ${check} -eq 1 ]; then choice="on"; fi if [ "${ElectRS}" != "${choice}" ]; then echo "ElectRS Setting changed .." anychange=1 - /home/admin/config.scripts/bonus.electrs.sh ${choice} + extraparameter="" + if [ "${choice}" = "off" ]; then + whiptail --title "Delete Electrum Index?" \ + --yes-button "Keep Index" \ + --no-button "Delete Index" \ + --yesno "ElectRS is getting uninstalled. Do you also want to delete the Electrum Index? It contains no important data, but can take multiple hours to rebuild if needed again." 10 60 + if [ $? -eq 1 ]; then + extraparameter="deleteindex" + fi + fi + /home/admin/config.scripts/bonus.electrs.sh ${choice} ${extraparameter} errorOnInstall=$? if [ "${choice}" = "on" ]; then if [ ${errorOnInstall} -eq 0 ]; then diff --git a/home.admin/97addMobileWallet.sh b/home.admin/97addMobileWallet.sh index 16d090b7c..2530d1123 100755 --- a/home.admin/97addMobileWallet.sh +++ b/home.admin/97addMobileWallet.sh @@ -78,7 +78,7 @@ OPTIONS=(ZAP_IOS "Zap Wallet (iOS)" \ # Additinal Options with TOR if [ "${runBehindTor}" = "on" ]; then - OPTIONS+=(FULLY_NODED "Fully Noded (IOS) over TOR") + OPTIONS+=(FULLY_NODED "Fully Noded (IOS+TOR)") fi CHOICE=$(whiptail --clear --title "Choose Mobile Wallet" --menu "" 13 50 7 "${OPTIONS[@]}" 2>&1 >/dev/tty) @@ -141,7 +141,7 @@ case $CHOICE in whiptail --title "Install Zap from PlayStore on your Android device" \ --yes-button "continue" \ --no-button "link as QR code" \ - --yesno "Find & install the Zap Wallet on the Android Play Store:\n\n${appstoreLink}\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue." 10 60 + --yesno "Find & install the Zap Wallet on the Android Play Store:\n\n${appstoreLink}\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue." 10 65 if [ $? -eq 1 ]; then /home/admin/config.scripts/blitz.lcd.sh qr-console ${appstoreLink} fi @@ -168,10 +168,10 @@ case $CHOICE in choose_IP_or_TOR appstoreLink="https://play.google.com/store/apps/details?id=com.zeusln.zeus" /home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink} - whiptail --title "Install Shango on your Android Phone" \ + whiptail --title "Install Zeus on your Android Phone" \ --yes-button "continue" \ --no-button "link as QR code" \ - --yesno "Find and install the Zeus Wallet on the Android Play Store:\n\n${appstoreLink}\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue." 10 60 + --yesno "Find and install the Zeus Wallet on the Android Play Store:\n\n${appstoreLink}\n\nEasiest way to install scan QR code on LCD with phone.\n\nWhen installed and started -> continue." 10 65 if [ $? -eq 1 ]; then /home/admin/config.scripts/blitz.lcd.sh qr-console ${appstoreLink} fi diff --git a/home.admin/config.scripts/bonus.electrs.sh b/home.admin/config.scripts/bonus.electrs.sh index dee640e71..e89797da6 100644 --- a/home.admin/config.scripts/bonus.electrs.sh +++ b/home.admin/config.scripts/bonus.electrs.sh @@ -449,11 +449,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo rm -rf /home/electrs/.rustup sudo rm -rf /home/electrs/.profile - - if [ "$2" == "keepindex" ]; then - echo "# keeping index db" - else - # delete also db by default (because in case HDD is full, deactivating should free data) + if [ "$2" == "deleteindex" ]; then sudo rm -rf /mnt/hdd/app-storage/electrs/ fi diff --git a/home.admin/config.scripts/bonus.lndconnect.sh b/home.admin/config.scripts/bonus.lndconnect.sh index f85d0fa61..b0935854d 100644 --- a/home.admin/config.scripts/bonus.lndconnect.sh +++ b/home.admin/config.scripts/bonus.lndconnect.sh @@ -28,7 +28,7 @@ fi # check if it is installed # https://github.com/rootzoll/lndconnect # using own fork of lndconnet because of this commit to fix for better QR code: -commit=e76226f2dd3cce3c169a7161f66612c2662407fa +commit=82d7103bb8c8dd3c8ae8de89e3bc061eef82bb8f isInstalled=$(lndconnect -h 2>/dev/null | grep "nocert" -c) if [ $isInstalled -eq 0 ] || [ "$1" == "update" ]; then echo "# Installing lndconnect.." @@ -39,7 +39,7 @@ if [ $isInstalled -eq 0 ] || [ "$1" == "update" ]; then # Install latest lndconnect from source: go get -d github.com/rootzoll/lndconnect cd $GOPATH/src/github.com/rootzoll/lndconnect - //git checkout $commit + git checkout $commit make else echo "# lndconnect is already installed"