Skip to content
Prev Previous commit
Next Next commit
Extend ServerInfo to Support FreeBSD
Signed-off-by: Matthew Wener <[email protected]>
  • Loading branch information
Matthew Wener authored and ConstrictM committed Jun 17, 2020
commit a4be63a25898f644bf91b4cd32161f73f8667fcb
5 changes: 2 additions & 3 deletions lib/OperatingSystems/FreeBSD.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public function getMemory(): array {

$data['MemTotal'] = (int)$return[0];
$data['MemAvailable'] = (int)$return[1] * ((int)$return[2] + (int)$return[3] + (int)$return[4]);

} catch (\RuntimeException $e) {
return $data;
}
Expand Down Expand Up @@ -101,7 +100,7 @@ public function getTime() {
*
* @return int
*/
public function getUptime(): int {
public function getUptime(): int {
try {
$uptime = $this->executeCommand('/sbin/sysctl -n kern.boottime | tr -d \',\' | cut -d \' \' -f4');
$time = $this->executeCommand('date +%s');
Expand Down Expand Up @@ -234,4 +233,4 @@ protected function executeCommand(string $command): string {
}
return $output;
}
}
}