瀏覽代碼

Get choice

Bob Mottram 8 年之前
父節點
當前提交
0eb3c678db
共有 1 個文件被更改,包括 6 次插入8 次删除
  1. 6
    8
      src/freedombone-controlpanel

+ 6
- 8
src/freedombone-controlpanel 查看文件

@@ -946,14 +946,12 @@ function restore_data_from_storage {
946 946
                          --radiolist $'Choose:' \
947 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 956
         # exit
959 957
         if [[ "$app_name" == "$ExitStr" ]]; then