Skip to content

Commit

Permalink
fix: FreeBSD variants (#4661)
Browse files Browse the repository at this point in the history
Restore them to one file, improve unit tests by adding FreeBSD to the string
  • Loading branch information
murrant committed Sep 29, 2016
1 parent a8037d9 commit 714d294
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
9 changes: 8 additions & 1 deletion includes/discovery/os/freebsd.inc.php
@@ -1,5 +1,12 @@
<?php

if (str_contains($sysDescr, 'FreeBSD')) {
// FreeBSD variants, check for specialized distros first
if (str_contains($sysDescr, 'pfSense')) {
$os = 'pfsense';
} elseif (str_contains($sysDescr, 'Voswall')) {
$os = 'voswall';
} elseif (str_contains($sysDescr, 'm0n0wall')) {
$os = 'monowall';
} elseif (str_contains($sysDescr, 'FreeBSD')) {
$os = 'freebsd';
}
5 changes: 0 additions & 5 deletions includes/discovery/os/monowall.inc.php

This file was deleted.

5 changes: 0 additions & 5 deletions includes/discovery/os/pfsense.inc.php

This file was deleted.

5 changes: 0 additions & 5 deletions includes/discovery/os/voswall.inc.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/snmpsim/monowall.snmprec
@@ -1 +1 @@
1.3.6.1.2.1.1.1.0|4|m0n0wall
1.3.6.1.2.1.1.1.0|4|m0n0wall FreeBSD
3 changes: 2 additions & 1 deletion tests/snmpsim/pfsense.snmprec
@@ -1 +1,2 @@
1.3.6.1.2.1.1.1.0|4|pfSense
1.3.6.1.2.1.1.1.0|4|pfSense 2.3.2-RELEASE pfSense FreeBSD 10.3-RELEASE-p5 amd64
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.12325.1.1.2.1.1
2 changes: 1 addition & 1 deletion tests/snmpsim/voswall.snmprec
@@ -1 +1 @@
1.3.6.1.2.1.1.1.0|4|Voswall
1.3.6.1.2.1.1.1.0|4|Voswall FreeBSD

0 comments on commit 714d294

Please sign in to comment.