dns.cgi: Restart unbound

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2020-01-08 18:10:23 +01:00
parent 770ea81ee5
commit 719db1cdb8

View File

@@ -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.