refactor os discovery s to w

This commit is contained in:
crcro
2016-09-22 02:34:17 +03:00
parent 52d6d0d9df
commit cfeb7258b5
24 changed files with 79 additions and 146 deletions

View File

@@ -1,21 +1,18 @@
<?php
if (!$os) {
if (preg_match('/^SunOS/', $sysDescr)) {
$os = 'solaris';
list(,,$version) = explode(' ', $sysDescr);
if ($version > '5.10') {
if (starts_with('SunOS', $sysDescr)) {
$os = 'solaris';
list(,,$version) = explode(' ', $sysDescr);
if(version_compare($version, '5.10', '>')) {
if (str_contains('oi_', $sysDescr)) {
$os = 'openindiana';
} else {
$os = 'opensolaris';
}
if ($version > '5.10') {
if (preg_match('/oi_/', $sysDescr)) {
$os = 'openindiana';
}
}
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.42.2.1.1')) {
$os = 'solaris';
}
}
if (str_contains('.1.3.6.1.4.1.42.2.1.1', $sysObjectId)) {
$os = 'solaris';
}