diff --git a/check_process b/check_process index 704a61c..29c0fd5 100644 --- a/check_process +++ b/check_process @@ -7,8 +7,8 @@ admin="john" (USER) language="fr" is_public=1 (PUBLIC|public=1|private=0) - password="pass" - port="666" (PORT) + password="pass" + port="666" (PORT) ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/scripts/backup b/scripts/backup index 297ea1d..7c88c04 100755 --- a/scripts/backup +++ b/scripts/backup @@ -2,13 +2,6 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit on command errors and treat access to unset variables as an error -set -eu - #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -21,6 +14,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 #================================================= diff --git a/scripts/install b/scripts/install index 99f09e7..6a4bcfa 100755 --- a/scripts/install +++ b/scripts/install @@ -141,7 +141,7 @@ ynh_systemd_config chown -R $app: $final_path # Set the app as temporarily public for curl call -ynh_app_setting_set $app unprotected_uris "/" +ynh_app_setting_set $app skipped_uris "/" # Reload SSOwat config yunohost app ssowatconf @@ -151,6 +151,12 @@ systemctl reload nginx # Installation with curl ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" +#================================================= +# MODIFY A CONFIG FILE +#================================================= + +ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE" + #================================================= # STORE THE CHECKSUM OF THE CONFIG FILE #================================================= diff --git a/scripts/restore b/scripts/restore index 6889fc7..73ac8e3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -2,13 +2,6 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit on command errors and treat access to unset variables as an error -set -eu - #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -21,6 +14,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 #================================================= @@ -113,7 +113,7 @@ systemctl enable $app.service ynh_restore_file "/etc/cron.d/$app" #================================================= -# BACKUP THE LOGROTATE CONFIGURATION +# RESTORE THE LOGROTATE CONFIGURATION #================================================= ynh_restore_file "/etc/logrotate.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index c8d2304..415963e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,7 +44,7 @@ fi # If final_path doesn't exist, create it if [ -z $final_path ]; then - final_path=$(ynh_sanitize_dbid $app) + final_path=/var/www/$app ynh_app_setting_set $app final_path $final_path fi @@ -52,11 +52,14 @@ fi # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_backup_before_upgrade # Backup the current version of the app +# Backup the current version of the app +ynh_backup_before_upgrade ynh_clean_setup () { - ynh_restore_upgradebackup # restore it if the upgrade fails + # restore it if the upgrade fails + ynh_restore_upgradebackup } -ynh_abort_if_errors # Exit if an error occurs during the execution of the script +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors #================================================= # CHECK THE PATH