1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/framagames_ynh.git synced 2024-09-03 18:36:28 +02:00

No backup before upgrade

This commit is contained in:
polytan02 2017-01-17 23:15:14 +00:00
parent cd56362dca
commit bd6536ad94

View file

@ -4,10 +4,10 @@
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Backup the current version of the app, restore it if the upgrade fails # Backup the current version of the app, restore it if the upgrade fails
if sudo yunohost backup list | grep -q ${app}-before-upgrade > /dev/null 2>&1; then # Supprime l'ancienne archive seulement si elle existe #if sudo yunohost backup list | grep -q ${app}-before-upgrade > /dev/null 2>&1; then # Supprime l'ancienne archive seulement si elle existe
sudo yunohost backup delete ${app}-before-upgrade # sudo yunohost backup delete ${app}-before-upgrade
fi #fi
sudo yunohost backup create --ignore-hooks --apps $app --name ${app}-before-upgrade #sudo yunohost backup create --ignore-hooks --apps $app --name ${app}-before-upgrade
EXIT_PROPERLY () { EXIT_PROPERLY () {
exit_code=$? exit_code=$?
if [ "$exit_code" -eq 0 ]; then if [ "$exit_code" -eq 0 ]; then
@ -19,8 +19,8 @@ EXIT_PROPERLY () {
sudo yunohost backup restore --ignore-hooks ${app}-before-upgrade --apps $app --force # Restore the backup if upgrade failed sudo yunohost backup restore --ignore-hooks ${app}-before-upgrade --apps $app --force # Restore the backup if upgrade failed
ynh_die "Upgrade failed. The app was restored to the way it was before the failed upgrade." ynh_die "Upgrade failed. The app was restored to the way it was before the failed upgrade."
} }
set -eu #set -eu
trap EXIT_PROPERLY EXIT #trap EXIT_PROPERLY EXIT
# Source app helpers # Source app helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers