From 9bf2490256f22f8695f2886e552fcb36b6e29f9b Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Tue, 16 Apr 2019 04:06:42 +0100 Subject: [PATCH] remove while --- home.admin/70initLND.sh | 47 ++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 584f31331..3640f8904 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -207,35 +207,30 @@ if [ ${walletExists} -eq 0 ]; then echo "choice($CHOICE)" if [ "${CHOICE}" == "ONLYSEED" ] || [ "${CHOICE}" == "SEED+SCB" ]; then - # enter SEED words - wordstring="" - while [ ${#wordstring} -eq 0 ] - do + echo "ENTER SEED" + # dialog to enter + #$_temp="/home/admin/.seed.tmp" + wordstring=$(whiptail --backtitle "RaspiBlitz - LND Recover" --inputbox "Please enter/paste the SEED WORD LIST:\n(just the words, seperated by commas, in correct order as numbered)" 9 78) + #wordstring=$( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' ) + #shred $_temp + echo "processing ..." - # dialog to enter - #$_temp="/home/admin/.seed.tmp" - wordstring=$(dialog --backtitle "RaspiBlitz - LND Recover" --inputbox "Please enter/paste the SEED WORD LIST:\n(just the words, seperated by commas, in correct order as numbered)" 9 78) - #wordstring=$( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' ) - #shred $_temp - echo "processing ..." + # remove spaces + wordstring=$(echo "${wordstring}" | sed 's/[^a-zA-Z0-9 ]//g') - # remove spaces - wordstring=$(echo "${wordstring}" | sed 's/[^a-zA-Z0-9 ]//g') - - # string to array - IFS=',' read -r -a seedArray <<< "$wordstring" + # string to array + IFS=',' read -r -a seedArray <<< "$wordstring" - # check array - if [ ${#seedArray[@]} -eq 24 ]; then - echo "OK - 24 words" - exit 1 - else - echo "wrong number of words" - wordstring="" - exit 1 - fi - sleep 3 - done + # check array + if [ ${#seedArray[@]} -eq 24 ]; then + echo "OK - 24 words" + exit 1 + else + echo "wrong number of words" + wordstring="" + exit 1 + fi + fi if [ "${CHOICE}" == "ONLYSEED" ]; then