From 0eb3c678db68021b1116092e1c84f45521336d6f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 24 Oct 2016 18:26:21 +0100 Subject: [PATCH] Get choice --- src/freedombone-controlpanel | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 788ab100..f601526a 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -946,14 +946,12 @@ function restore_data_from_storage { --radiolist $'Choose:' \ 30 40 20 $applist) - sel=$? - case $sel in - 1) return;; - 255) return;; - esac - selected_index=$(cat $data) - selected_index=$[selected_index-1] - app_name=${app_list[selected_index]} + if [ $? -ne 0 ]; then + break + fi + app_index=$[choice-1] + app_index=$[app_index-1] + app_name=${app_list[app_index]} # exit if [[ "$app_name" == "$ExitStr" ]]; then