Bob Mottram преди 8 години
родител
ревизия
a5daaa17ef
променени са 1 файла, в които са добавени 17 реда и са изтрити 2 реда
  1. 17
    2
      src/freedombone-controlpanel

+ 17
- 2
src/freedombone-controlpanel Целия файл

919
 function restore_data_from_storage {
919
 function restore_data_from_storage {
920
     restore_type="$1"
920
     restore_type="$1"
921
 
921
 
922
-    restore_command="${PROJECT_NAME}-restore-local $USB_DRIVE"
923
     if [[ $restore_type != "local" ]]; then
922
     if [[ $restore_type != "local" ]]; then
924
         restore_command="${PROJECT_NAME}-restore-remote $remote_domain_name configuration;;"
923
         restore_command="${PROJECT_NAME}-restore-remote $remote_domain_name configuration;;"
925
     else
924
     else
926
         remote_domain_name="$1"
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
     fi
943
     fi
929
 
944
 
930
     utils_installed=(config
945
     utils_installed=(config