|
@@ -365,43 +365,37 @@ function backup_database_to_friend {
|
365
|
365
|
|
366
|
366
|
function backup_apps {
|
367
|
367
|
localremote=$1
|
368
|
|
- FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
|
369
|
368
|
|
370
|
369
|
BACKUP_APPS_COMPLETED=()
|
371
|
370
|
|
372
|
|
- # for all the app scripts
|
373
|
|
- for filename in $FILES
|
|
371
|
+ detect_installable_apps
|
|
372
|
+ get_apps_installed_names
|
|
373
|
+
|
|
374
|
+ for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
374
|
375
|
do
|
375
|
|
- app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
376
|
|
- if [[ $(item_in_array ${app_name} ${BACKUP_APPS_COMPLETED[@]}) != 0 ]]; then
|
377
|
|
- if [[ "$(app_is_installed $a)" == "1" ]]; then
|
378
|
|
- BACKUP_APPS_COMPLETED+=("${app_name}")
|
379
|
|
- backup_${localremote}_${app_name}
|
380
|
|
- fi
|
381
|
|
- fi
|
|
376
|
+ echo $"Backup ${app_name}"
|
|
377
|
+ function_check backup_${localremote}_${app_name}
|
|
378
|
+ backup_${localremote}_${app_name}
|
|
379
|
+ BACKUP_APPS_COMPLETED+=("${app_name}")
|
|
380
|
+ echo $"Backup ${app_name} completed"
|
382
|
381
|
done
|
383
|
382
|
}
|
384
|
383
|
|
385
|
384
|
function restore_apps {
|
386
|
385
|
localremote=$1
|
387
|
|
- FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
|
388
|
386
|
|
389
|
387
|
RESTORE_APPS_COMPLETED=()
|
390
|
388
|
|
391
|
|
- # for all the app scripts
|
392
|
|
- for filename in $FILES
|
|
389
|
+ detect_installable_apps
|
|
390
|
+ get_apps_installed_names
|
|
391
|
+
|
|
392
|
+ for app_name in "${APPS_INSTALLED_NAMES[@]}"
|
393
|
393
|
do
|
394
|
|
- app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
395
|
|
- if [[ $RESTORE_APP == 'all' || $RESTORE_APP == "${app_name}" ]]; then
|
396
|
|
- if [[ $(item_in_array ${app_name} ${RESTORE_APPS_COMPLETED[@]}) != 0 ]]; then
|
397
|
|
- function_check app_is_installed
|
398
|
|
- if [[ "$(app_is_installed $a)" == "1" ]]; then
|
399
|
|
- RESTORE_APPS_COMPLETED+=("${app_name}")
|
400
|
|
- function_check restore_${localremote}_${app_name}
|
401
|
|
- restore_${localremote}_${app_name}
|
402
|
|
- fi
|
403
|
|
- fi
|
404
|
|
- fi
|
|
394
|
+ echo $"Restoring ${app_name}"
|
|
395
|
+ function_check restore_${localremote}_${app_name}
|
|
396
|
+ restore_${localremote}_${app_name}
|
|
397
|
+ RESTORE_APPS_COMPLETED+=("${app_name}")
|
|
398
|
+ echo $"Restored ${app_name}"
|
405
|
399
|
done
|
406
|
400
|
}
|
407
|
401
|
|