Improve OpenWRT detection (#15096)

* Improve OpenWRT detection

* Add test data

* Remplace openwrt date with new one
This commit is contained in:
Garcia MICHEL
2023-06-12 13:59:24 +02:00
committed by GitHub
parent 0ed68e33de
commit e547945985
4 changed files with 2630 additions and 844 deletions

View File

@@ -46,8 +46,8 @@ class Openwrt extends OS implements
*/
public function discoverOS(Device $device): void
{
$device->version = explode(' ', trim(snmp_get($this->getDeviceArray(), '.1.3.6.1.4.1.2021.7890.1.101.1', '-Osqnv'), '"'))[1];
$device->hardware = trim(snmp_get($this->getDeviceArray(), '.1.3.6.1.4.1.2021.7890.2.101.1', '-Osqnv'), '"');
[, $device->version] = explode(' ', snmp_get($this->getDeviceArray(), 'NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."distro"', '-Osqnv'));
$device->hardware = snmp_get($this->getDeviceArray(), 'NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."hardware"', '-Osqnv');
}
/**