File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,10 +168,15 @@ public function getNetworkInterfaces() {
168168 preg_match ("/(?<=\<).*(?=-)/m " , $ intface , $ duplex );
169169
170170 $ iface ['mac ' ] = implode (' ' , $ mac [0 ]);
171- $ iface ['status ' ] = $ status [0 ];
172171 $ iface ['speed ' ] = $ speed [0 ];
173172
174- if ($ iface ['speed ' ] !== '' ) {
173+ if (isset ($ status [0 ])) {
174+ $ iface ['status ' ] = $ status [0 ];
175+ } else {
176+ $ iface ['status ' ] = 'active ' ;
177+ }
178+
179+ if (isset ($ iface ['speed ' ])) {
175180 if (strpos ($ iface ['speed ' ], 'G ' )) {
176181 $ iface ['speed ' ] = rtrim ($ iface ['speed ' ], 'G ' );
177182 $ iface ['speed ' ] = $ iface ['speed ' ] . ' Gbps ' ;
@@ -182,7 +187,7 @@ public function getNetworkInterfaces() {
182187 $ iface ['speed ' ] = 'unknown ' ;
183188 }
184189
185- if ($ duplex [0 ] !== '' ) {
190+ if (isset ( $ duplex [0 ]) ) {
186191 $ iface ['duplex ' ] = 'Duplex: ' . $ duplex [0 ];
187192 } else {
188193 $ iface ['duplex ' ] = '' ;
You can’t perform that action at this time.
0 commit comments