mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
dns.cgi: Restart unbound
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user