From 0ef792141d7e94723169b8f4ca658cb0a9fbd92c Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 2 May 2016 13:01:23 +0000 Subject: [PATCH] Scrut fix + code format --- includes/discovery/os/linux.inc.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/includes/discovery/os/linux.inc.php b/includes/discovery/os/linux.inc.php index 76871fcd6..094ffd3c1 100644 --- a/includes/discovery/os/linux.inc.php +++ b/includes/discovery/os/linux.inc.php @@ -18,40 +18,40 @@ if (!$os) { if (strstr($sysObjectId, '.1.3.6.1.4.1.5528.100.20.10.2014') || strstr($sysObjectId, '.1.3.6.1.4.1.5528.100.20.10.2016')) { $os = 'netbotz'; } - else if (strstr($sysDescr, 'endian')) { + elseif (strstr($sysDescr, 'endian')) { $os = 'endian'; } - else if (preg_match('/Cisco Small Business/', $sysDescr)) { + elseif (preg_match('/Cisco Small Business/', $sysDescr)) { $os = 'ciscosmblinux'; } - else if (strpos($entPhysicalMfgName, 'QNAP') !== false) { + elseif (strpos($entPhysicalMfgName, 'QNAP') !== false) { $os = 'qnap'; } - else if (stristr($sysObjectId, 'packetlogic') || strstr($sysObjectId, '.1.3.6.1.4.1.15397.2')) { + elseif (stristr($sysObjectId, 'packetlogic') || strstr($sysObjectId, '.1.3.6.1.4.1.15397.2')) { $os = 'procera'; } - else if (strstr($sysObjectId, '.1.3.6.1.4.1.10002.1') || strstr($sysObjectId, '.1.3.6.1.4.1.41112.1.4') || strpos(trim(snmp_get($device, 'dot11manufacturerName.5', '-Osqnv', 'IEEE802dot11-MIB')), 'Ubiquiti') !== false) { + elseif (strstr($sysObjectId, '.1.3.6.1.4.1.10002.1') || strstr($sysObjectId, '.1.3.6.1.4.1.41112.1.4') || strpos(trim(snmp_get($device, 'dot11manufacturerName.5', '-Osqnv', 'IEEE802dot11-MIB')), 'Ubiquiti') !== false) { $os = 'airos'; if (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.5', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { $os = 'unifi'; } - else if (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.2', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { + elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.2', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { $os = 'unifi'; } - else if (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.3', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { + elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.3', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { $os = 'unifi'; } - else if (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.4', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { + elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.4', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { $os = 'unifi'; } - else if (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.6', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { + elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.6', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) { $os = 'unifi'; } - else if (trim(snmp_get($device, 'fwVersion.1', '-Osqnv', 'UBNT-AirFIBER-MIB')) != '') { + elseif (trim(snmp_get($device, 'fwVersion.1', '-Osqnv', 'UBNT-AirFIBER-MIB')) != '') { $os = 'airos-af'; } } - else if (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) { + elseif (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) { $os = 'pktj'; $pktj_mibs = array ( "rxCounter" => "GANDI-MIB", // RX Packets @@ -70,6 +70,7 @@ if (!$os) { } elseif (strstr($sysObjectId, '.1.3.6.1.4.1.8072.3.2.10')) { $os = 'sophos'; + } else { // Check for Synology DSM $hrSystemInitialLoadParameters = trim(snmp_get($device, 'HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0', '-Osqnv'));