diff --git a/hooks/post_cert_update b/hooks/post_cert_update new file mode 100644 index 0000000..91d776e --- /dev/null +++ b/hooks/post_cert_update @@ -0,0 +1,5 @@ +#!/bin/bash + +if [ $1 == __DOMAIN__ ]; then + systemctl restart matrix-__APP__ +fi diff --git a/scripts/backup b/scripts/backup index 645ff1f..7c1727a 100644 --- a/scripts/backup +++ b/scripts/backup @@ -100,6 +100,14 @@ ynh_script_progression --message="Backing up synapse log..." --weight=1 ynh_backup --src_path="/var/log/matrix-$app" +#================================================= +# BACKUP HOOKS +#================================================= +ynh_script_progression --message="Backing up synapse hook..." --weight=1 + +# Copy hook +ynh_backup --src_path "/etc/yunohost/hooks.d/post_cert_update/50-$app" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 49c2c78..4a8280a 100644 --- a/scripts/install +++ b/scripts/install @@ -363,6 +363,15 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 # The script "add_sso_conf.py" will just add en entry for the path "/_matrix" in the sso conf.json.persistent file in the cathegory "skipped_urls". python3 ../conf/add_sso_conf.py || ynh_die --message="Your file /etc/ssowat/conf.json.persistent doesn't respect the json syntax. Please fix the syntax to install this app. For more information see here: https://github.com/YunoHost-Apps/synapse_ynh/issues/32" +#================================================= +# UPDATE HOOKS +#================================================= + +# WARNING : theses command are used in INSTALL, UPGRADE +# For any update do it in all files +ynh_replace_string __APP__ $app ../hooks/post_cert_update +ynh_replace_string __DOMAIN__ $domain ../hooks/post_cert_update + #================================================= # SECURE FILES AND DIRECTORIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 47f3ffe..892f552 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -381,6 +381,15 @@ chmod 600 /etc/matrix-$app/$server_name.signing.key setfacl -R -m user:turnserver:rX /etc/matrix-$app setfacl -R -m user:turnserver:rwX /var/log/matrix-$app +#================================================= +# UPDATE HOOKS +#================================================= + +# WARNING : theses command are used in INSTALL, UPGRADE +# For any update do it in all files +ynh_replace_string __APP__ $app ../hooks/post_cert_update +ynh_replace_string __DOMAIN__ $domain ../hooks/post_cert_update + #================================================= # UPDATE VERSION SETTINGS #=================================================