mirror of
https://github.com/unraid/api.git
synced 2026-01-07 17:19:52 -06:00
refactor: state get updateOs details from /tmp/unraidcheck/response.json
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user