[2/2] urlfilter.cgi: Fixes bug#10649 - calls urlfilterctrl with remove option if update disabled

Message ID 20230926140701.3438340-2-adolf.belka@ipfire.org
State Staged
Commit cb741b5a66046150c922a469dc19bb876f216c5f
Headers
Series [1/2] urlfilterctrl: Fix bug#10649 - add option to remove urlfilter from fcron directories |

Commit Message

Adolf Belka Sept. 26, 2023, 2:07 p.m. UTC
  - When the url filter update enable checkbox is unchecked then this patch calls
   urlfilterctrl with the remove option added in the otrher patch of this series.
- Tested on my vm testbed that this change does remove the urlfilter symlink from the
   fcron directories when the update is disabled.

Fixes: Bug#10649
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 html/cgi-bin/urlfilter.cgi | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/html/cgi-bin/urlfilter.cgi b/html/cgi-bin/urlfilter.cgi
index 1e54372f1..1ced06e26 100644
--- a/html/cgi-bin/urlfilter.cgi
+++ b/html/cgi-bin/urlfilter.cgi
@@ -982,6 +982,11 @@  if ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter save schedule'})
 		{
 			&General::system('/usr/local/bin/urlfilterctrl', 'cron', 'monthly');
 		}
+		
+		if ($filtersettings{'ENABLE_AUTOUPDATE'} eq 'off')
+		{
+			&General::system('/usr/local/bin/urlfilterctrl', 'cron', 'remove');
+		}
 	}
 }