From 4864bb867a314b47b75da29491f4ede31d6fdda6 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 8 Jun 2021 20:24:33 +0200 Subject: [PATCH] self-test notify_push --- scripts/install | 11 +++++++++++ scripts/restore | 11 +++++++++++ scripts/upgrade | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/scripts/install b/scripts/install index 41afca7..3908260 100755 --- a/scripts/install +++ b/scripts/install @@ -281,6 +281,17 @@ ynh_script_progression --message="Configuring Fail2Ban..." --weight=8 # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 +#================================================= +# CHECK IF NOTIFY_PUSH WORKS +#================================================= + +if [ $use_notify_push -eq 1 ] +then + if ! ynh_exec_as "$app" nextcloud php7.3 $final_path/occ notify_push:self-test; then + ynh_print_warn --message="High Performance Backend is not working correctly, try to repair it or contact YNH support." + fi +fi + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 4a4e276..0641d44 100755 --- a/scripts/restore +++ b/scripts/restore @@ -146,6 +146,17 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=3 ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# CHECK IF NOTIFY_PUSH WORKS +#================================================= + +if [ $use_notify_push -eq 1 ] +then + if ! ynh_exec_as "$app" nextcloud php7.3 $final_path/occ notify_push:self-test; then + ynh_print_warn --message="High Performance Backend is not working correctly, try to repair it or contact YNH support." + fi +fi + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6440851..fe83a2d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -401,6 +401,17 @@ ynh_use_logrotate --non-append # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 +#================================================= +# CHECK IF NOTIFY_PUSH WORKS +#================================================= + +if [ $use_notify_push -eq 1 ] +then + if ! ynh_exec_as "$app" nextcloud php7.3 $final_path/occ notify_push:self-test; then + ynh_print_warn --message="High Performance Backend is not working correctly, try to repair it or contact YNH support." + fi +fi + #================================================= # END OF SCRIPT #=================================================