Browse Source

Get choice

Bob Mottram 8 years ago
parent
commit
0eb3c678db
1 changed files with 6 additions and 8 deletions
  1. 6
    8
      src/freedombone-controlpanel

+ 6
- 8
src/freedombone-controlpanel View File

946
                          --radiolist $'Choose:' \
946
                          --radiolist $'Choose:' \
947
                          30 40 20 $applist)
947
                          30 40 20 $applist)
948
 
948
 
949
-        sel=$?
950
-        case $sel in
951
-            1) return;;
952
-            255) return;;
953
-        esac
954
-        selected_index=$(cat $data)
955
-        selected_index=$[selected_index-1]
956
-        app_name=${app_list[selected_index]}
949
+        if [ $? -ne 0 ]; then
950
+            break
951
+        fi
952
+        app_index=$[choice-1]
953
+        app_index=$[app_index-1]
954
+        app_name=${app_list[app_index]}
957
 
955
 
958
         # exit
956
         # exit
959
         if [[ "$app_name" == "$ExitStr" ]]; then
957
         if [[ "$app_name" == "$ExitStr" ]]; then