Skip to content

Commit

Permalink
switch to glob over ls
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosCypher committed Jun 15, 2021
1 parent 0f06ea4 commit 5b3c515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bidir-traffic-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function checkSudo () {
# populates an array of network interfaces
function getInterfaces () {
if (( ${#INTERFACES[@]} < 1 )); then
for iface in "$(find /sys/class/net ! -type d -printf '%f\n')"; do
for iface in /sys/class/net/*; do
INTERFACES+=("$iface")
done
fi
Expand All @@ -36,7 +36,7 @@ function getInterfaces () {
function ignoreInterfaces() {
if (( ${#IGNORE_INTERFACES[@]} >= 1 )); then
for iface in "${IGNORE_INTERFACES[@]}"; do
INTERFACES=( "${INTERFACES[@]/$iface/}" )
INTERFACES=( "${INTERFACES[@]/*$iface/}" )
done
fi
}
Expand Down

0 comments on commit 5b3c515

Please sign in to comment.