RunOnFlux/fluxnode-multitool

[FEATURE_REQUEST] Back or Stop functionality

Opened this issue · 1 comments

Is your feature request related to a problem? If so, please describe.

In many cases when you are installing a node you will receive a series of prompts to enter information. If you make a mistake at a specific point in time. There is no way for you to stop back and then correct an error. Love to see a feature where a user input is required to be able to go back. Personally i have made mistake regarding keys or values entered. Another place where i have made mistakes and couldnt go back and had to start again was on Option 4 regarding the Discord notifications. You cannot continue it will keep asking you for discord tags ect even if you make a mistake.

Describe the solution you'd like

Specifically when user input is required post providing that detail the ability to stop or go back and amend. Not sure if this is possible with scripting.

Priority

Low (Nice-to-have)

Is this something you would be keen to implement

No

I have been working on something like this for anything that takes user input and only has specific options - the while loop gives the user the chance to go back and fix or change their choices.

while true
    do 
      server_choice=$(whiptail --title "Choose your FluxOS boostrap Server " --radiolist \
        "Use the UP/DOWN arrows to highlight the server you want. Press Spacebar on the server ID you want to select, THEN press ENTER." 17 50 8 \
        "5" "US Server" ON \
        "6" "US Server" OFF \
        "7" "US Server" OFF \
        "8" "EU Server" OFF \
        "9" "EU Server" OFF \
        "10" "EU Server" OFF \
        "11" "EU Server" OFF \
        "12" "AS Server" OFF 3>&1 1>&2 2>&3)
        if [[ $server_choice != "" ]]; then
          if whiptail --yesno "Is this the server you would like to use?\n\nhttp://cdn-$server_choice.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz" 10 95; then
            bootstrap_url="http://cdn-$server_choice.runonflux.io/apps/fluxshare/getfile/flux_explorer_bootstrap.tar.gz"
            break
          fi
        else
          if whiptail --yesno "Would you like to use your own URL?" 8 80; then
            bootstrap_url=$(whiptail --inputbox "Enter your Flux bootstrap URL" 8 65 3>&1 1>&2 2>&3)
            if [[ "$bootstrap_url" != "" ]]; then
              if whiptail --yesno "Is this the server you would like to use?\n\n $bootstrap_url" 10 95; then
                  break
              fi
            fi          
          fi
        fi
    done