From 94b6f1dda965f457078d288ebec80039ed5a8204 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 4 Feb 2024 23:07:54 +0200 Subject: [PATCH] Fix to restart Nginx once --- virtual_feature.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/virtual_feature.pl b/virtual_feature.pl index f8606eb..a02b5ff 100644 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -3438,7 +3438,11 @@ sub feature_add_protected_dir }; &save_directive($server, [ ], [ $protected ]); &flush_config_file_lines(); - &apply_nginx(); + &virtual_server::push_all_print(); + &virtual_server::set_all_null_print(); + &virtual_server::register_post_action(\&print_apply_nginx); + &virtual_server::run_post_actions(); + &virtual_server::pop_all_print(); $status = 0; } &unlock_all_config_files(); @@ -3475,7 +3479,11 @@ sub feature_delete_protected_dir # Can delete the location block &save_directive($server, [ $loc ], [ ]); &flush_config_file_lines(); - &apply_nginx(); + &virtual_server::push_all_print(); + &virtual_server::set_all_null_print(); + &virtual_server::register_post_action(\&print_apply_nginx); + &virtual_server::run_post_actions(); + &virtual_server::pop_all_print(); $status = 0; } else {