diff --git a/scripts/backup b/scripts/backup index 7ed3c7f..62c38c6 100755 --- a/scripts/backup +++ b/scripts/backup @@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +use_notify_push=$(ynh_app_setting_get --app=$app --key=use_notify_push) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -86,6 +87,15 @@ ynh_print_info --message="Backing up data directory..." ynh_backup --src_path="/home/yunohost.app/${app}/data" --is_big +#================================================= +# BACKUP THE NOTIFY_PUSH APP +#================================================= + +if [ $use_notify_push -eq 1 ] +then + ynh_backup --src_path="/etc/systemd/system/${app}-notify-push.service" +fi + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index 2614a88..ebc58ae 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +use_notify_push=$(ynh_app_setting_get --app=$app --key=use_notify_push) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -80,6 +81,14 @@ then # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" + + if [ $use_notify_push -eq 1 ] + then + string_use_notify_push="" + else + string_use_notify_push="#" + fi + # Create a dedicated NGINX config ynh_add_nginx_config fi diff --git a/scripts/remove b/scripts/remove index 4df124d..527610e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -85,6 +85,7 @@ ynh_remove_fail2ban_config ynh_script_progression --message="Stopping and removing the systemd service..." ynh_remove_systemd_config --service="${app}-notify-push" +ynh_secure_remove --file="/var/run/$app/" #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index c62a6e4..508a963 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +use_notify_push=$(ynh_app_setting_get --app=$app --key=use_notify_push) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) @@ -129,7 +130,7 @@ ynh_restore_file --origin_path="$datadir" --not_mandatory mkdir -p "$datadir" #================================================= -# CONFIGURE NOTIFY_PUSH APP +# RESTORE THE NOTIFY_PUSH APP #================================================= if [ $use_notify_push -eq 1 ] @@ -137,8 +138,9 @@ then mkdir -p /var/run/$app/ chown $app: /var/run/$app/ - ynh_add_systemd_config --service="${app}-notify-push" + ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push.service" + systemctl enable $app.service --quiet ynh_systemd_action --service_name="${app}-notify-push" --action=restart fi