bug fixes
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

This commit is contained in:
wt
2025-03-07 01:48:10 +07:00
parent 2f0ccc55b6
commit 39957c7436
4 changed files with 17 additions and 10 deletions
+4 -4
View File
@@ -14,14 +14,14 @@ namespace api
{ {
if (!new_ftp_enabled) if (!new_ftp_enabled)
{ {
system("rc stop ftp"); system("rc stop ftpd");
system("rc del ftp"); system("rc del ftpd");
syslog(LOG_INFO, "%s", "Ftp is disabled"); syslog(LOG_INFO, "%s", "Ftp is disabled");
} }
else else
{ {
system("rc start ftp"); system("rc start ftpd");
system("rc add ftp"); system("rc add ftpd");
syslog(LOG_INFO, "%s", "Ftp is enabled"); syslog(LOG_INFO, "%s", "Ftp is enabled");
} }
} }
+8 -1
View File
@@ -21,7 +21,14 @@ namespace api
keysfile << key << "\n"; keysfile << key << "\n";
} }
keysfile.close(); keysfile.close();
system("rc restart ssh"); if (get_ssh_server() == OPENSSH_SSH)
{
system("rc restart ssh");
}
else if (get_ssh_server() == DROPBEAR_SSH)
{
system("rc restart dropbear");
}
syslog(LOG_INFO, "%s", "SSH keys changed"); syslog(LOG_INFO, "%s", "SSH keys changed");
} }
} }
+4 -4
View File
@@ -14,14 +14,14 @@ namespace api
{ {
if (!new_telnet_enabled) if (!new_telnet_enabled)
{ {
system("rc stop telnet"); system("rc stop telnetd");
system("rc del telnet"); system("rc del telnetd");
syslog(LOG_INFO, "%s", "Telnet is disabled"); syslog(LOG_INFO, "%s", "Telnet is disabled");
} }
else else
{ {
system("rc start telnet"); system("rc start telnetd");
system("rc add telnet"); system("rc add telnetd");
syslog(LOG_INFO, "%s", "Telnet is enabled"); syslog(LOG_INFO, "%s", "Telnet is enabled");
} }
} }
+1 -1
View File
@@ -24,7 +24,7 @@ namespace api
+ TELNET_PORT_FILE; + TELNET_PORT_FILE;
std::cout << systemrequest << std::endl; std::cout << systemrequest << std::endl;
system(systemrequest.c_str()); system(systemrequest.c_str());
system("rc restart telnet"); system("rc restart telnetd");
std::string syslogstring = "Telnet port changed to " + std::to_string(new_telnet_port); std::string syslogstring = "Telnet port changed to " + std::to_string(new_telnet_port);
syslog(LOG_INFO, "%s", syslogstring.c_str()); syslog(LOG_INFO, "%s", syslogstring.c_str());
} }