From 7630ae87d497d59af6a15e1bd0c6608bc594fbfd Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Tue, 19 Dec 2023 16:45:20 -0500 Subject: [PATCH] refactor: state get updateOs details from /tmp/unraidcheck/response.json --- .../plugins/dynamix.my.servers/include/state.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php index 5c78b0f86..dcc2f71c9 100644 --- a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php +++ b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php @@ -47,6 +47,7 @@ class ServerState private $rebootDetails; private $caseModel = ''; private $keyfileBase64UrlSafe = ''; + private $updateOs; public $myServersFlashCfg = []; public $myServersMemoryCfg = []; @@ -162,6 +163,11 @@ class ServerState $this->keyfileBase64 = @base64_encode($this->keyfileBase64); $this->keyfileBase64UrlSafe = str_replace(['+', '/', '='], ['-', '_', ''], trim($this->keyfileBase64)); } + + /** + * updateOs response is provided by the unraidcheck script saving to /tmp/unraidcheck/response.json + */ + $this->updateOs = @json_decode(@file_get_contents('/tmp/unraidcheck/response.json'), true); } /** @@ -243,6 +249,10 @@ class ServerState $serverState['combinedKnownOrigins'] = $this->combinedKnownOrigins; } + if ($this->updateOs) { + $serverState['updateOs'] = $this->updateOs; + } + return $serverState; }