]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
dns.cgi: Restart unbound
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 8 Jan 2020 17:10:23 +0000 (18:10 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 8 Jan 2020 17:12:38 +0000 (18:12 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/dns.cgi

index 41212ea4ad2cbb3dd7b3fcaa26020f29d624e813..9683959b658735f93fb85ec23e7f299e146d5071 100755 (executable)
@@ -88,6 +88,9 @@ if ($cgiparams{'GENERAL'} eq $Lang::tr{'save'}) {
 
        # Store settings into settings file.
        &General::writehash("$settings_file", \%cgiparams);
+
+       # Call function to handle unbound restart, etc.
+       &_handle_unbound_and_more()
 }
 
 ###
@@ -174,6 +177,9 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
 
                # Write the changed hash to the config file.
                &General::writehasharray($servers_file, \%dns_servers);
+
+               # Call function to handle unbound restart, etc.
+               &_handle_unbound_and_more();
        } else {
                # Switch back to previous mode.
                $cgiparams{'SERVERS'} = $cgiparams{'MODE'};
@@ -785,6 +791,12 @@ END
        &Header::closebox();
 }
 
+# Private function to handle the restart of unbound and more.
+sub _handle_unbound_and_more () {
+       # Restart unbound
+       system('/usr/local/bin/unboundctrl restart >/dev/null');
+}
+
 # Check if the system is online (RED is connected).
 sub red_is_active () {
        # Check if the "active" file is present.