mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
then en trop et ynh_die avant helpers
This commit is contained in:
parent
de45255dc9
commit
6ee618fd55
1 changed files with 3 additions and 4 deletions
|
@ -3,6 +3,9 @@
|
||||||
# Load common variables and helpers
|
# Load common variables and helpers
|
||||||
source ./_common.sh
|
source ./_common.sh
|
||||||
|
|
||||||
|
# Source app helpers
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Set app specific variables
|
# Set app specific variables
|
||||||
app=$APPNAME
|
app=$APPNAME
|
||||||
dbname=$app
|
dbname=$app
|
||||||
|
@ -33,7 +36,6 @@ EXIT_PROPERLY () {
|
||||||
set +eu
|
set +eu
|
||||||
echo "Upgrade failed." >&2
|
echo "Upgrade failed." >&2
|
||||||
if sudo yunohost backup list | grep -q $app-before-upgrade$backup_number > /dev/null 2>&1; then # Vérifie l'existence de l'archive avant de supprimer l'application et de restaurer
|
if sudo yunohost backup list | grep -q $app-before-upgrade$backup_number > /dev/null 2>&1; then # Vérifie l'existence de l'archive avant de supprimer l'application et de restaurer
|
||||||
then
|
|
||||||
sudo yunohost app remove $app # Supprime l'application avant de la restaurer.
|
sudo yunohost app remove $app # Supprime l'application avant de la restaurer.
|
||||||
sudo yunohost backup restore --ignore-hooks $app-before-upgrade$backup_number --apps $app --force # Restore the backup if upgrade failed
|
sudo yunohost backup restore --ignore-hooks $app-before-upgrade$backup_number --apps $app --force # Restore the backup if upgrade failed
|
||||||
ynh_die "The app was restored to the way it was before the failed upgrade."
|
ynh_die "The app was restored to the way it was before the failed upgrade."
|
||||||
|
@ -42,9 +44,6 @@ EXIT_PROPERLY () {
|
||||||
set -eu
|
set -eu
|
||||||
trap EXIT_PROPERLY EXIT
|
trap EXIT_PROPERLY EXIT
|
||||||
|
|
||||||
# Source app helpers
|
|
||||||
source /usr/share/yunohost/helpers
|
|
||||||
|
|
||||||
# Migrate from ownCloud to Nextcloud
|
# Migrate from ownCloud to Nextcloud
|
||||||
if [[ $YNH_APP_INSTANCE_NAME != $app ]]; then
|
if [[ $YNH_APP_INSTANCE_NAME != $app ]]; then
|
||||||
[[ $YNH_APP_ID == owncloud ]] \
|
[[ $YNH_APP_ID == owncloud ]] \
|
||||||
|
|
Loading…
Add table
Reference in a new issue