From f2d83cef7dd221f129a63aedefcd9a74212cfc99 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 28 Mar 2022 10:43:58 +0200 Subject: #915 Set boot mode to ogLive on client creation Otherwise, users have to use POST /modes to make clients bootable. --- src/rest.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rest.c b/src/rest.c index 38d9c08..b7552ca 100644 --- a/src/rest.c +++ b/src/rest.c @@ -1523,6 +1523,14 @@ static int og_cmd_post_client_add(json_t *element, } dbi_result_free(result); + + if (og_set_client_mode(dbi, computer.mac, computer.boot)) { + syslog(LOG_ERR, "failed to set client boot mode (%s:%d)\n", + __func__, __LINE__); + og_dbi_close(dbi); + return -1; + } + og_dbi_close(dbi); return 0; } -- cgit v1.2.3-18-g5258