2018-06-14 02:13:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2018-08-31 01:11:12 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK IF AN UPGRADE IS NEEDED
|
|
|
|
#=================================================
|
|
|
|
ynh_check_app_version_changed
|
|
|
|
|
2018-06-14 02:13:59 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Backup the current version of the app
|
|
|
|
ynh_backup_before_upgrade
|
|
|
|
ynh_clean_setup () {
|
|
|
|
# restore it if the upgrade fails
|
|
|
|
ynh_restore_upgradebackup
|
|
|
|
}
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
2019-05-21 16:48:54 +02:00
|
|
|
# Replace backports with pip
|
|
|
|
if is_stretch; then
|
2019-06-10 18:43:50 +02:00
|
|
|
rm -f /etc/apt/sources.list.d/$app-stretch-backports.list
|
2019-05-21 16:48:54 +02:00
|
|
|
|
2019-05-21 17:05:24 +02:00
|
|
|
install_borg_with_pip
|
2019-05-21 16:48:54 +02:00
|
|
|
fi
|
2020-02-27 17:34:43 +01:00
|
|
|
rm -f /etc/yunohost/hooks.d/backup/17-data_home
|