From a0dc5b43502d41bf94fb781bcd7815ed4a37d8ae Mon Sep 17 00:00:00 2001 From: Jaromil Date: Fri, 30 Dec 2016 17:36:16 +0100 Subject: [PATCH] fix to network device detection --- zuper | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zuper b/zuper index ed711ce..ac7f5a1 100755 --- a/zuper +++ b/zuper @@ -562,14 +562,14 @@ maps+=(net_ip4_exit) # maps+=(ip6exits) net.scan_devices() { - for i in "${(f)$(find /sys/devices/ -name net)}"; do - dev=`ls --indicator-style=none $i` - - # skip the loopback device - [[ "$dev" =~ "^lo" ]] && continue - func "$dev" - net_devices+=($dev) - done + for i in ${(f)"$(find /sys/devices/ -name net)"}; do + for dev in ${(f)"$(ls --indicator-style=none $i)"}; do + # skip the loopback device + [[ "$dev" =~ "^lo" ]] && continue + func "found network device: $dev" + net_devices+=($dev) + done + done # return error if no device found if [[ ${#net_devices} = 0 ]]; then return 1