]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
dns.cgi: Restart suricata if neccessary.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 9 Jan 2020 15:36:39 +0000 (16:36 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 9 Jan 2020 15:36:39 +0000 (16:36 +0100)
When the DNS configuration of the system is changed,
we need to re-generate the file which contains the DNS Server
details for suricata and to restart the service.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/dns.cgi

index 450d5c4840d74334c5d1800fcbb985d9f6f85770..cb6f16f67ac17818238a202da7ad85b09c60dd19 100755 (executable)
@@ -28,6 +28,7 @@ use IO::Socket;
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/ids-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -801,6 +802,16 @@ END
 sub _handle_unbound_and_more () {
        # Restart unbound
        system('/usr/local/bin/unboundctrl restart >/dev/null');
+
+       # Check if the IDS is running.
+       if(&IDS::ids_is_running()) {
+               # Re-generate the file which contains the DNS Server
+               # details.
+               &IDS::generate_dns_servers_file();
+
+               # Call suricatactrl to perform a reload.
+               &IDS::call_suricatactrl("restart");
+       }
 }
 
 # Check if the system is online (RED is connected).