Browse Source

Remove restore directory if it exists

Bob Mottram 8 years ago
parent
commit
f04afc2a39
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/freedombone-utils-backup

+ 3
- 0
src/freedombone-utils-backup View File

562
     if [ -d $USB_MOUNT/backup/${restore_app_name} ]; then
562
     if [ -d $USB_MOUNT/backup/${restore_app_name} ]; then
563
         echo $"Restoring ${restore_app_name} database"
563
         echo $"Restoring ${restore_app_name} database"
564
         local_database_dir=/root/temp${restore_app_name}data
564
         local_database_dir=/root/temp${restore_app_name}data
565
+        if [ -d ${local_database_dir} ]; then
566
+            rm -rf ${local_database_dir}
567
+        fi
565
         function_check restore_directory_from_usb
568
         function_check restore_directory_from_usb
566
         restore_directory_from_usb "${local_database_dir}" "${restore_app_name}data"
569
         restore_directory_from_usb "${local_database_dir}" "${restore_app_name}data"
567
         if [ ! -f /root/temp${restore_app_name}data/${RESTORE_SUBDIR}/temp${restore_app_name}data/${restore_app_name}.sql ]; then
570
         if [ ! -f /root/temp${restore_app_name}data/${RESTORE_SUBDIR}/temp${restore_app_name}data/${restore_app_name}.sql ]; then