1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pytition_ynh.git synced 2024-09-03 20:16:08 +02:00

Small corrections

This commit is contained in:
Maniack Crudelis 2017-09-05 17:48:23 +02:00
parent 5ef1d07752
commit 5039df052d
5 changed files with 31 additions and 22 deletions

View file

@ -2,13 +2,6 @@
#================================================= #=================================================
# GENERIC START # GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit on command errors and treat access to unset variables as an error
set -eu
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
@ -21,6 +14,13 @@ fi
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # LOAD SETTINGS
#================================================= #=================================================

View file

@ -141,7 +141,7 @@ ynh_systemd_config
chown -R $app: $final_path chown -R $app: $final_path
# Set the app as temporarily public for curl call # 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 # Reload SSOwat config
yunohost app ssowatconf yunohost app ssowatconf
@ -151,6 +151,12 @@ systemctl reload nginx
# Installation with curl # Installation with curl
ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" 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 # STORE THE CHECKSUM OF THE CONFIG FILE
#================================================= #=================================================

View file

@ -2,13 +2,6 @@
#================================================= #=================================================
# GENERIC START # GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit on command errors and treat access to unset variables as an error
set -eu
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
@ -21,6 +14,13 @@ fi
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # LOAD SETTINGS
#================================================= #=================================================
@ -113,7 +113,7 @@ systemctl enable $app.service
ynh_restore_file "/etc/cron.d/$app" ynh_restore_file "/etc/cron.d/$app"
#================================================= #=================================================
# BACKUP THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_restore_file "/etc/logrotate.d/$app" ynh_restore_file "/etc/logrotate.d/$app"

View file

@ -44,7 +44,7 @@ fi
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z $final_path ]; then 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 ynh_app_setting_set $app final_path $final_path
fi fi
@ -52,11 +52,14 @@ fi
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # 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_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 # CHECK THE PATH