Some small updates to if() if()

This commit is contained in:
Neil Lathwood
2016-09-23 22:30:53 +01:00
parent 91ce012cd0
commit 88a6146d5e
5 changed files with 9 additions and 23 deletions
+1 -3
View File
@@ -2,8 +2,6 @@
if (str_contains($sysDescr, 'ProSafe')) {
$os = 'netgear';
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.4526')) {
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.4526')) {
$os = 'netgear';
}
+1 -3
View File
@@ -2,8 +2,6 @@
if (starts_with($sysDescr, 'NetMan') && str_contains($sysDescr, 'plus')) {
$os = 'netmanplus';
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.5491.6')) {
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.5491.6')) {
$os = 'netmanplus';
}
+5 -11
View File
@@ -2,16 +2,10 @@
if (str_contains($sysDescr, 'PowerConnect') && !str_contains($sysDescr, 'ArubaOS')) {
$os = 'powerconnect';
}
if (str_contains($sysDescr, 'Neyland 24T')) {
$os = 'powerconnect';
}
if (str_contains($sysDescr, 'Dell', true) && str_contains($sysDescr, 'Gigabit Ethernet', true)) {
$os = 'powerconnect';
}
if (str_contains(snmp_get($device, '.1.3.6.1.4.1.674.10895.3000.1.2.100.1.0', '-Oqv', ''), 'PowerConnect')) {
} elseif (str_contains($sysDescr, 'Neyland 24T')) {
$os = 'powerconnect';
} elseif (str_contains($sysDescr, 'Dell', true) && str_contains($sysDescr, 'Gigabit Ethernet', true)) {
$os = 'powerconnect';
} elseif (str_contains(snmp_get($device, '.1.3.6.1.4.1.674.10895.3000.1.2.100.1.0', '-Oqv', ''), 'PowerConnect', true)) {
$os = 'powerconnect';
}
+1 -3
View File
@@ -2,8 +2,6 @@
if (starts_with($sysDescr, array('Prestige '))) {
$os = 'prestige';
}
if (preg_match('/^P-.*-/', $sysDescr)) {
} elseif (preg_match('/^P-.*-/', $sysDescr)) {
$os = 'prestige';
}
+1 -3
View File
@@ -2,9 +2,7 @@
if (str_contains($sysDescr, array('ProCurve', 'HP 1820'))) {
$os = 'procurve';
}
if (preg_match('/eCos-[0-9.]+/', $sysDescr)) {
} elseif (preg_match('/eCos-[0-9.]+/', $sysDescr)) {
$os = 'procurve';
} elseif (preg_match('/HP(.+)2530(.+)/', $sysDescr)) {
$os = 'procurve';