initial commit

This commit is contained in:
wt committed 2025-09-09 13:19:59 +07:00
commit 9246e48f03
39 files changed
+34142

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#include "ConfigManager.h"
#include "settings_file.h"
#include "config.h"
#include <file.h>
void get_settings_file(struct mg_connection *c, struct mg_http_message *hm) {
char *filename = cm_get_parameter_as_string(config, "dnsmasq_config");
if (!filename) {
mg_http_reply(c, 500, HTTP_HEADERS, "{%m:%m}", MG_ESC("error"),
MG_ESC("can't read config file"));
return;
}
char *data = read_file(filename);
mg_http_reply(c, 200, "Content-Type: text/plain\r\nAccess-Control-Allow-Origin: *\r\n", data);
free(data);
free(filename);
}