Browse Source

fix to network device detection

Jaromil 3 years ago
parent
commit
a0dc5b4350
1 changed files with 8 additions and 8 deletions
  1. 8 8
      zuper

+ 8 - 8
zuper

@@ -562,14 +562,14 @@ maps+=(net_ip4_exit)
562 562
 # maps+=(ip6exits)
563 563
 
564 564
 net.scan_devices() {
565
-    for i in "${(f)$(find /sys/devices/ -name net)}"; do
566
-        dev=`ls --indicator-style=none $i`
567
-
568
-        # skip the loopback device
569
-        [[ "$dev" =~ "^lo" ]] && continue
570
-        func "$dev"
571
-        net_devices+=($dev)
572
-    done
565
+    for i in ${(f)"$(find /sys/devices/ -name net)"}; do
566
+		for dev in ${(f)"$(ls --indicator-style=none $i)"}; do
567
+			# skip the loopback device
568
+			[[ "$dev" =~ "^lo" ]] && continue
569
+			func "found network device: $dev"
570
+			net_devices+=($dev)
571
+		done
572
+	done
573 573
 
574 574
     # return error if no device found
575 575
     if [[ ${#net_devices} = 0 ]]; then return 1