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
735 B
C++
31 lines
735 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 set_ftp(bool new_ftp_enabled)
|
|
{
|
|
if (!new_ftp_enabled)
|
|
{
|
|
system("rc stop ftp");
|
|
system("rc del ftp");
|
|
syslog(LOG_INFO, "%s", "Ftp is disabled");
|
|
}
|
|
else
|
|
{
|
|
system("rc start ftp");
|
|
system("rc add ftp");
|
|
syslog(LOG_INFO, "%s", "Ftp is enabled");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|