Bob Mottram il y a 8 ans
Parent
révision
7f970fe02c
2 fichiers modifiés avec 32 ajouts et 22 suppressions
  1. 17
    12
      src/freedombone-restore-local
  2. 15
    10
      src/freedombone-restore-remote

+ 17
- 12
src/freedombone-restore-local Voir le fichier

112
         temp_restore_dir=/root/tempconfig
112
         temp_restore_dir=/root/tempconfig
113
         restore_directory_from_usb $temp_restore_dir config
113
         restore_directory_from_usb $temp_restore_dir config
114
 
114
 
115
-        cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
116
-        if [ ! "$?" = "0" ]; then
117
-            set_user_permissions
118
-            backup_unmount_drive
119
-            rm -rf $temp_restore_dir
120
-            exit 5294
115
+        if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
116
+            cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
117
+            if [ ! "$?" = "0" ]; then
118
+                set_user_permissions
119
+                backup_unmount_drive
120
+                rm -rf $temp_restore_dir
121
+                exit 5294
122
+            fi
121
         fi
123
         fi
124
+
122
         if [ -f $CONFIGURATION_FILE ]; then
125
         if [ -f $CONFIGURATION_FILE ]; then
123
             # install according to the config file
126
             # install according to the config file
124
             freedombone -c $CONFIGURATION_FILE
127
             freedombone -c $CONFIGURATION_FILE
125
         fi
128
         fi
126
 
129
 
127
-        cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
128
-        if [ ! "$?" = "0" ]; then
129
-            set_user_permissions
130
-            backup_unmount_drive
131
-            rm -rf $temp_restore_dir
132
-            exit 6382
130
+        if [ -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt ]; then
131
+            cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
132
+            if [ ! "$?" = "0" ]; then
133
+                set_user_permissions
134
+                backup_unmount_drive
135
+                rm -rf $temp_restore_dir
136
+                exit 6382
137
+            fi
133
         fi
138
         fi
134
 
139
 
135
         if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then
140
         if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then

+ 15
- 10
src/freedombone-restore-remote Voir le fichier

119
         temp_restore_dir=/root/tempconfig
119
         temp_restore_dir=/root/tempconfig
120
         restore_directory_from_friend $temp_restore_dir config
120
         restore_directory_from_friend $temp_restore_dir config
121
 
121
 
122
-        cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
123
-        if [ ! "$?" = "0" ]; then
124
-            unmount_drive
125
-            rm -rf $temp_restore_dir
126
-            exit 5372
122
+        if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
123
+            cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
124
+            if [ ! "$?" = "0" ]; then
125
+                unmount_drive
126
+                rm -rf $temp_restore_dir
127
+                exit 5372
128
+            fi
127
         fi
129
         fi
130
+
128
         if [ -f $CONFIGURATION_FILE ]; then
131
         if [ -f $CONFIGURATION_FILE ]; then
129
             # install according to the config file
132
             # install according to the config file
130
             freedombone -c $CONFIGURATION_FILE
133
             freedombone -c $CONFIGURATION_FILE
131
         fi
134
         fi
132
 
135
 
133
-        cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
134
-        if [ ! "$?" = "0" ]; then
135
-            unmount_drive
136
-            rm -rf $temp_restore_dir
137
-            exit 7252
136
+        if [ -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt ]; then
137
+            cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
138
+            if [ ! "$?" = "0" ]; then
139
+                unmount_drive
140
+                rm -rf $temp_restore_dir
141
+                exit 7252
142
+            fi
138
         fi
143
         fi
139
 
144
 
140
         if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then
145
         if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then