diff --git a/conf/post_iptable_rules_hook b/hooks/post_iptable_rules similarity index 100% rename from conf/post_iptable_rules_hook rename to hooks/post_iptable_rules diff --git a/scripts/backup b/scripts/backup index 48d569f..ffa889e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,7 +27,7 @@ ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" ynh_backup "/etc/nginx/conf.d/monitorix_status.conf" "monitorix_status.conf" # Copy hook -ynh_backup "/usr/share/yunohost/hooks/post_iptable_rules/50-$app" +ynh_backup "/etc/yunohost/hooks.d/post_iptable_rules/50-$app" # Copy Monitorix configuration ynh_backup "/etc/monitorix" "config" diff --git a/scripts/install b/scripts/install index 43cb030..93928a1 100755 --- a/scripts/install +++ b/scripts/install @@ -51,10 +51,6 @@ config_nginx # Update monitorix configuration config_monitorix -# Add hook -mkdir -p /usr/share/yunohost/hooks/post_iptable_rules -cp ../conf/post_iptable_rules_hook /usr/share/yunohost/hooks/post_iptable_rules/50-$app - #================================================= # GENERIC FINALIZATION #================================================= @@ -71,4 +67,4 @@ yunohost service add monitorix sudo systemctl stop monitorix.service sleep 1 pkill -f "monitorix-httpd listening on" || true -ynh_check_starting ' - Ok, ready.' '/var/log/monitorix' \ No newline at end of file +ynh_check_starting ' - Ok, ready.' '/var/log/monitorix' diff --git a/scripts/remove b/scripts/remove index 296064e..086f56f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,6 @@ ynh_mysql_drop_user "$dbuser" || true # Remove data ynh_secure_remove /var/lib/monitorix -ynh_secure_remove /usr/share/yunohost/hooks/post_iptable_rules/50-$app # Remove nginx config ynh_secure_remove "/etc/nginx/conf.d/monitorix_status.conf" diff --git a/scripts/upgrade b/scripts/upgrade index c3ed308..cdb62f2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,9 +48,8 @@ config_nginx # Update monitorix configuration config_monitorix -# Add hook -mkdir -p /usr/share/yunohost/hooks/post_iptable_rules -cp ../conf/post_iptable_rules_hook /usr/share/yunohost/hooks/post_iptable_rules/50-$app +# Remove old hook if exist +ynh_secure_remove /usr/share/yunohost/hooks/post_iptable_rules/50-$app #================================================= # GENERIC FINALIZATION