firstcontact: support server:port syntax inside redirector field

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-08-24 08:01:22 +02:00
parent 8b2b5a32d1
commit 3755107433

View File

@@ -43,8 +43,11 @@ if (!config.Redirector) {
function store_config(path) {
let cursor = uci.cursor(path);
let redir = split(config.Redirector, ":");
cursor.load("ucentral");
cursor.set("ucentral", "config", "server", config.Redirector);
cursor.set("ucentral", "config", "server", redir[0]);
cursor.set("ucentral", "config", "port", redir[1] || 15002);
cursor.commit();
}