From 3c938f69f77bfa099d0b4f56b95bb9efe5a96ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Sun, 17 Jun 2018 21:57:04 +0200 Subject: [PATCH] Fix package_linter errors Made scripts closer to example_ynh, mostly by fixing comments and using ynh_abort_if_errors helper which fixes package_linter errors --- scripts/backup | 2 +- scripts/install | 8 ++++---- scripts/remove | 4 ++-- scripts/restore | 19 ++++++++++--------- scripts/upgrade | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/scripts/backup b/scripts/backup index 6fba36d..dddcdab 100644 --- a/scripts/backup +++ b/scripts/backup @@ -7,7 +7,7 @@ #================================================= # Exit on command errors and treat unset variables as an error -set -eu +ynh_abort_if_errors #================================================= # IMPORT GENERIC HELPERS diff --git a/scripts/install b/scripts/install index d807a74..cf3eb46 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,7 +10,7 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE FAILURE OF THE SCRIPT +# MANAGE SCRIPT FAILURE #================================================= # Exit if an error occurs during the execution of the script @@ -26,7 +26,7 @@ path_url=$YNH_APP_ARG_PATH app=$YNH_APP_INSTANCE_NAME #================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THIS ARGS +# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= # Normalize the url path syntax @@ -63,7 +63,7 @@ yunohost firewall allow Both $peer_port >/dev/null 2>&1 ynh_app_setting_set $app peer_port $peer_port #================================================= -# INSTALL TRANSMISSION +# INSTALL DEPENDENCIES #================================================= ynh_install_app_dependencies transmission-daemon acl diff --git a/scripts/remove b/scripts/remove index f09a23c..b8a14c1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -83,7 +83,7 @@ ynh_secure_remove /usr/share/transmission ynh_secure_remove /var/lib/transmission-daemon #================================================= -# GENERIC FINALISATION +# GENERIC FINALIZATION #================================================= # REMOVE DEDICATED USER #================================================= diff --git a/scripts/restore b/scripts/restore index f10f782..9dd877e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,13 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING -#================================================= -# MANAGE FAILURE OF THE SCRIPT -#================================================= - -# Exit on command errors and treat unset variables as an error -set -eu +# GENERIC START #================================================= # IMPORT GENERIC HELPERS @@ -21,6 +15,13 @@ fi source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= @@ -40,9 +41,9 @@ ynh_webpath_available $domain $path_url \ || ynh_die "Path not available: ${domain}${path_url}" #================================================= -# STANDARD RESTORE STEPS +# STANDARD RESTORATION STEPS #================================================= -# RESTORE OF THE NGINX CONFIGURATION +# RESTORE THE NGINX CONFIGURATION #================================================= ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 43eb9f2..99b50ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #=================================================