dracut-module-setup.sh: fix a loop over ls issue

Iterating over ls output is fragile:
https://github.com/koalaman/shellcheck/wiki/SC2045

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
Kairui Song 2021-08-04 16:16:44 +08:00
parent dfe7555323
commit 3b2fa982bb

View File

@ -353,7 +353,9 @@ kdump_setup_ifname() {
kdump_setup_bridge() {
local _netdev=$1
local _brif _dev _mac _kdumpdev
for _dev in `ls /sys/class/net/$_netdev/brif/`; do
for _dev in "/sys/class/net/$_netdev/brif/"*; do
[[ -e $_dev ]] || continue
_dev=${_dev##*/}
_kdumpdev=$_dev
if kdump_is_bond "$_dev"; then
$(kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")")