summaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c
index f6de95e..5befa9c 100644
--- a/src/client.c
+++ b/src/client.c
@@ -286,6 +286,7 @@ static int og_resp_refresh(json_t *data, struct og_client *cli)
struct og_partition disks[OG_DISK_MAX] = {};
const char *serial_number = NULL;
struct og_computer computer = {};
+ const char *status = NULL;
char cfg[4096] = {};
struct og_dbi *dbi;
const char *key;
@@ -304,12 +305,19 @@ static int og_resp_refresh(json_t *data, struct og_client *cli)
err = og_json_parse_partition_array(value, partitions);
} else if (!strcmp(key, "serial_number")) {
err = og_json_parse_string(value, &serial_number);
+ } else if (!strcmp(key, "status")) {
+ err = og_json_parse_string(value, &status);
}
if (err < 0)
return err;
}
+ if (status && !strncmp(status, "LINUX", strlen("LINUX"))) {
+ cli->status = OG_CLIENT_STATUS_LINUX;
+ return 0;
+ }
+
if (strlen(serial_number) > 0)
snprintf(cfg, sizeof(cfg), "ser=%s\n", serial_number);