Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Waiting to run
28 lines
668 B
C++
28 lines
668 B
C++
#include <settings/dns/dns.hpp>
|
|
#include <syslog.h>
|
|
|
|
namespace api
|
|
{
|
|
namespace settings
|
|
{
|
|
namespace dns
|
|
{
|
|
void set_dns(bool new_dns_enabled)
|
|
{
|
|
if (!new_dns_enabled)
|
|
{
|
|
system("rc stop dnsmasq");
|
|
system("rc del dnsmasq");
|
|
syslog(LOG_INFO, "%s", "DNS is disabled");
|
|
}
|
|
else
|
|
{
|
|
system("rc restart dnsmasq");
|
|
system("rc add dnsmasq");
|
|
syslog(LOG_INFO, "%s", "DNS is enabled");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|