From 7719f82c34e28c6373ad9d065640dd9775b1b9e6 Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 23 May 2017 12:03:22 +0200 Subject: [PATCH] [mod] use 'ynh_die' and 'set -eu'. --- scripts/install | 4 ++-- scripts/upgrade | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3bb9ec1..4b67ab7 100644 --- a/scripts/install +++ b/scripts/install @@ -20,12 +20,12 @@ source /usr/share/yunohost/helpers # Check port availability sudo yunohost app checkport $port if [[ ! $? -eq 0 ]]; then - exit 1 + ynh_die fi # Check if su_password is not empty if [[ -z "$su_passwd" ]]; then - exit 1 + ynh_die fi # Save app settings diff --git a/scripts/upgrade b/scripts/upgrade index 05a7907..a1a1178 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,2 +1,4 @@ #!/bin/bash +# Exit on command errors and treat unset variables as an error +set -eu