浏览代码

local restore

Bob Mottram 8 年前
父节点
当前提交
a5daaa17ef
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17
    2
      src/freedombone-controlpanel

+ 17
- 2
src/freedombone-controlpanel 查看文件

@@ -919,12 +919,27 @@ function backup_data {
919 919
 function restore_data_from_storage {
920 920
     restore_type="$1"
921 921
 
922
-    restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
923 922
     if [[ $restore_type != "local" ]]; then
924 923
         restore_command="${PROJECT_NAME}-restore-remote $remote_domain_name configuration;;"
925 924
     else
926 925
         remote_domain_name="$1"
927
-        restore_command="${PROJECT_NAME}-restore-remote $remote_domain_name"
926
+        if [ ! -b $USB_DRIVE ]; then
927
+            if [ -b /dev/sdb1 ]; then
928
+                USB_DRIVE=/dev/sdb1
929
+            fi
930
+            if [ -b /dev/sdc1 ]; then
931
+                USB_DRIVE=/dev/sdc1
932
+            fi
933
+            if [ -b /dev/sdd1 ]; then
934
+                USB_DRIVE=/dev/sdd1
935
+            fi
936
+            if [ -b /dev/sde1 ]; then
937
+                USB_DRIVE=/dev/sde1
938
+            fi
939
+            write_config_param USB_DRIVE "$USB_DRIVE"
940
+        fi
941
+
942
+        restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
928 943
     fi
929 944
 
930 945
     utils_installed=(config