#include #include #define SSH_REQUIRED_STRING R"({"required":"[token,status]"})" namespace api { namespace settings { namespace ssh { void set_ssh_status(bool new_ssh_status) { if (!new_ssh_status) { if (get_ssh_server() == DROPBEAR_SSH) { system("rc stop dropbear"); system("rc del dropbear"); } else if (get_ssh_server() == OPENSSH_SSH) { system("rc stop ssh"); system("rc del ssh"); } syslog(LOG_INFO, "%s", "SSH is disabled"); } else { if (get_ssh_server() == DROPBEAR_SSH) { system("rc start dropbear"); system("rc add dropbear"); } else if (get_ssh_server() == OPENSSH_SSH) { system("rc start ssh"); system("rc add ssh"); } syslog(LOG_INFO, "%s", "SSH is enabled"); } } } } }