From 0d82ab71af9e8fe2abe0d45bfe3db1c4dae77863 Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Tue, 16 Apr 2019 14:23:51 +0100 Subject: [PATCH] win/fail user feedback --- home.admin/70initLND.sh | 51 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 04f737a..24ccdff 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -284,8 +284,29 @@ to protect the seed words. Most users dont set this. # trigger wallet recovery source <(python /home/admin/config.scripts/lnd.initwallet.py seed ${passwordC} ${wordstring} ${passwordD}) - echo "TODO: ONLYSEED words(${wordstring})" - exit 1 + # on success the python script should return the seed words again + if [ ${#seedwords} -gt 1 ]; then + dialog --title " SUCCESS " --msgbox " +Looks good :) LND was able to recover the wallet. + " 7 53 + else + if [ ${#err} -eq 0 ]; then + echo + echo "FAIL!! Unkown Error - check output above for any hints and report to development." + echo "PRESS ENTER to try again." + read key + /home/admin/70initLND.sh + exit 1 + else + whiptail --title " FAIL " --msgbox " +Something went wrong - see info below: +${err} +${errMore} + " 13 72 + /home/admin/70initLND.sh + exit 1 + fi + fi elif [ "${CHOICE}" == "SEED+SCB" ]; then @@ -337,8 +358,30 @@ to protect the seed words. Most users dont set this. # trigger wallet recovery source <(python /home/admin/config.scripts/lnd.initwallet.py seed ${passwordC} ${wordstring} /home/admin/channel.backup ${passwordD}) - echo "TODO: Implement recovery with channel backup file" - exit 1 + # WIN/FAIL User feedback + # on success the python script should return the seed words again + if [ ${#seedwords} -gt 1 ]; then + dialog --title " SUCCESS " --msgbox " +Looks good :) LND was able to recover the wallet. + " 7 53 + else + if [ ${#err} -eq 0 ]; then + echo + echo "FAIL!! Unkown Error - check output above for any hints and report to development." + echo "PRESS ENTER to try again." + read key + /home/admin/70initLND.sh + exit 1 + else + whiptail --title " FAIL " --msgbox " +Something went wrong - see info below: +${err} +${errMore} + " 13 72 + /home/admin/70initLND.sh + exit 1 + fi + fi elif [ "${CHOICE}" == "LNDRESCUE" ]; then sudo /home/admin/config.scripts/lnd.rescue.sh restore