From 57069824e93c441ad37b96d2ab0f8ed474f90b54 Mon Sep 17 00:00:00 2001 From: Thibault Debatty <thibault.debatty@gmail.com> Date: Sat, 22 Dec 2018 16:24:34 +0100 Subject: [PATCH] show graphic --- web/app/Sensor/Ifconfig.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/app/Sensor/Ifconfig.php b/web/app/Sensor/Ifconfig.php index 043e2d5..f2506df 100644 --- a/web/app/Sensor/Ifconfig.php +++ b/web/app/Sensor/Ifconfig.php @@ -102,6 +102,8 @@ class Ifconfig extends AbstractSensor { */ public function parseIfconfig($string) { + $allowed_prefixes = ["en", "eth"]; + if ($string == null) { return []; } @@ -112,6 +114,10 @@ class Ifconfig extends AbstractSensor { foreach ($lines as $line) { $name = $this->pregMatchOne(self::IFNAME, $line); if ($name !== false) { + if (!\starts_with($name, $allowed_prefixes)) { + continue; + } + // Starting the section of a new interface $if = new NetworkInterface(); $interfaces[] = $if; -- GitLab