formated code
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 committed 2025-02-13 19:25:56 +07:00
1 parent d1a08ba5ce
commit f4bcead439
46 files changed
+23674 -22776

No files matched your search

+8 -6
View File
@@ -15,7 +15,7 @@ namespace api
{
namespace ssh
{
void get_ssh_status(const httplib::Request &request, httplib::Response &response)
void get_ssh_status(const httplib::Request& request, httplib::Response& response)
{
std::cout << GREEN << request.path << RESET << " " << request.method << std::endl;
response.set_header("Access-Control-Allow-Origin", "*");
@@ -37,7 +37,7 @@ namespace api
response.set_content(responsedata.str(), JSON_TYPE);
}
void set_ssh_status(const httplib::Request &request, httplib::Response &response)
void set_ssh_status(const httplib::Request& request, httplib::Response& response)
{
std::cout << GREEN << request.path << RESET << " " << request.method << std::endl;
response.set_header("Access-Control-Allow-Origin", "*");
@@ -62,11 +62,12 @@ namespace api
bool new_ssh_status = json_body["status"];
if (!new_ssh_status)
{
if (get_ssh_server() == DROPBEAR_SSH)
if (get_ssh_server() == DROPBEAR_SSH)
{
system("rc stop dropbear");
system("rc del dropbear");
} else if (get_ssh_server() == OPENSSH_SSH) {
}
else if (get_ssh_server() == OPENSSH_SSH) {
system("rc stop ssh");
system("rc del ssh");
}
@@ -74,11 +75,12 @@ namespace api
}
else
{
if (get_ssh_server() == DROPBEAR_SSH)
if (get_ssh_server() == DROPBEAR_SSH)
{
system("rc start dropbear");
system("rc add dropbear");
} else if (get_ssh_server() == OPENSSH_SSH) {
}
else if (get_ssh_server() == OPENSSH_SSH) {
system("rc start ssh");
system("rc add ssh");
}