From 351a285a4a9d981c4c07f7fb630f6685c6ec8228 Mon Sep 17 00:00:00 2001 From: polytan02 Date: Fri, 24 Feb 2017 23:57:56 +0000 Subject: [PATCH] set -eu & ynh_die --- scripts/backup | 1 + scripts/restore | 5 +++-- scripts/upgrade | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index f6484b1..5ddf19d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,4 +1,5 @@ #!/bin/bash +set -eu # Source app helpers source /usr/share/yunohost/helpers diff --git a/scripts/restore b/scripts/restore index e81e2fe..6e2db97 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,4 +1,5 @@ #!/bin/bash +set -eu # Source app helpers source /usr/share/yunohost/helpers @@ -14,14 +15,14 @@ db_pass=$(ynh_app_setting_get $app db_pass) if [ -d $final_path ]; then echo "There is already a directory: $final_path " >&2 - exit 1 + ynh_die fi # Restore Nginx conf=/etc/nginx/conf.d/$domain.d/$app.conf if [ -f $conf ]; then echo "There is already a nginx conf file at this path: $conf " >&2 - exit 1 + ynh_die fi sudo cp -a ./nginx.conf $conf diff --git a/scripts/upgrade b/scripts/upgrade index 54fe0f8..3d6fdd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,4 +1,5 @@ #!/bin/bash +set -eu source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script