Files
openrouter/src/settings/telnet/enabled.cpp
T
wt cedc9cd995
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
making easy
2025-02-20 18:07:59 +07:00

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");
}
}
}
}
}