Files
openrouter/src/settings/telnet/enabled.cpp
T
wt 39957c7436
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
bug fixes
2025-03-07 01:48:10 +07:00

31 lines
778 B
C++

#include <settings/telnet/telnet.hpp>
#include <syslog.h>
#include <stdlib.h>
#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 telnetd");
system("rc del telnetd");
syslog(LOG_INFO, "%s", "Telnet is disabled");
}
else
{
system("rc start telnetd");
system("rc add telnetd");
syslog(LOG_INFO, "%s", "Telnet is enabled");
}
}
}
}
}