Bob Mottram 10 år sedan
förälder
incheckning
7b210a20e4
1 ändrade filer med 6 tillägg och 1 borttagningar
  1. 6
    1
      install-freedombone.sh

+ 6
- 1
install-freedombone.sh Visa fil

3081
 	  echo "  obnam -r $USB_MOUNT/backup/dlna /var/cache/minidlna" >> /usr/bin/$BACKUP_SCRIPT_NAME
3081
 	  echo "  obnam -r $USB_MOUNT/backup/dlna /var/cache/minidlna" >> /usr/bin/$BACKUP_SCRIPT_NAME
3082
   fi
3082
   fi
3083
   echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
3083
   echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
3084
+  echo 'Backup completed' >> /usr/bin/$BACKUP_SCRIPT_NAME
3085
+  echo 'exit 0' >> /usr/bin/$RESTORE_SCRIPT_NAME
3084
   chmod 600 /usr/bin/$BACKUP_SCRIPT_NAME
3086
   chmod 600 /usr/bin/$BACKUP_SCRIPT_NAME
3085
   chmod +x /usr/bin/$BACKUP_SCRIPT_NAME
3087
   chmod +x /usr/bin/$BACKUP_SCRIPT_NAME
3086
 
3088
 
3099
   echo "    mount $USB_DRIVE $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
3101
   echo "    mount $USB_DRIVE $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
3100
   echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3102
   echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3101
   echo "  if [ ! -d $USB_MOUNT/backup ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME
3103
   echo "  if [ ! -d $USB_MOUNT/backup ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME
3102
-  echo "    mkdir $USB_MOUNT/backup" >> /usr/bin/$RESTORE_SCRIPT_NAME
3104
+  echo '    echo "No backup directory was found on the USB drive"' >> /usr/bin/$RESTORE_SCRIPT_NAME
3105
+  echo "    exit 1" >> /usr/bin/$RESTORE_SCRIPT_NAME
3103
   echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3106
   echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3104
   # email
3107
   # email
3105
   if ! [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" ]]; then
3108
   if ! [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_NONMAILBOX" ]]; then
3169
       echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3172
       echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3170
   fi
3173
   fi
3171
   echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3174
   echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3175
+  echo 'Restore completed' >> /usr/bin/$RESTORE_SCRIPT_NAME
3176
+  echo 'exit 0' >> /usr/bin/$RESTORE_SCRIPT_NAME
3172
   chmod 600 /usr/bin/$RESTORE_SCRIPT_NAME
3177
   chmod 600 /usr/bin/$RESTORE_SCRIPT_NAME
3173
   chmod +x /usr/bin/$RESTORE_SCRIPT_NAME
3178
   chmod +x /usr/bin/$RESTORE_SCRIPT_NAME
3174
 
3179