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
31 lines
744 B
C++
31 lines
744 B
C++
#include <settings/ftp/ftp.hpp>
|
|
#include <syslog.h>
|
|
#include <stdlib.h>
|
|
|
|
#define FTP_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
|
|
|
namespace api
|
|
{
|
|
namespace settings
|
|
{
|
|
namespace ftp
|
|
{
|
|
void Ftp::set_ftp(bool new_ftp_enabled)
|
|
{
|
|
if (!new_ftp_enabled)
|
|
{
|
|
system("rc stop ftpd");
|
|
system("rc del ftpd");
|
|
syslog(LOG_INFO, "%s", "Ftp is disabled");
|
|
}
|
|
else
|
|
{
|
|
system("rc start ftpd");
|
|
system("rc add ftpd");
|
|
syslog(LOG_INFO, "%s", "Ftp is enabled");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|