From: Stefan Schantl Date: Wed, 8 Jan 2020 17:10:23 +0000 (+0100) Subject: dns.cgi: Restart unbound X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=719db1cdb80ce4a11f932c4bc0c92196f423e902;p=people%2Fms%2Fipfire-2.x.git dns.cgi: Restart unbound Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 41212ea4ad..9683959b65 100755 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -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.