refactor: state get updateOs details from /tmp/unraidcheck/response.json

This commit is contained in:
Zack Spear
2023-12-19 16:45:20 -05:00
committed by Zack Spear
parent 127e2c3be6
commit 7630ae87d4

View File

@@ -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;
}