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
31 lines
774 B
C++
31 lines
774 B
C++
#include <settings/telnet/telnet.hpp>
|
|
#include <syslog.h>
|
|
#include <iostream>
|
|
|
|
#define TELNET_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
|
|
|
namespace api
|
|
{
|
|
namespace settings
|
|
{
|
|
namespace telnet
|
|
{
|
|
void set_telnet(bool new_telnet_enabled)
|
|
{
|
|
if (!new_telnet_enabled)
|
|
{
|
|
system("rc stop telnet");
|
|
system("rc del telnet");
|
|
syslog(LOG_INFO, "%s", "Telnet is disabled");
|
|
}
|
|
else
|
|
{
|
|
system("rc start telnet");
|
|
system("rc add telnet");
|
|
syslog(LOG_INFO, "%s", "Telnet is enabled");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|