dracut-module-setup.sh: improve the approach to get a bridged interface list
When directory is empty, echo * will output *, not empty string. That's not intended. Also it looks a little bit nicer now. Signed-off-by: WANG Chao <chaowang@redhat.com> Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
parent
76602596e0
commit
dd7ce4b5fd
@ -100,6 +100,7 @@ kdump_get_perm_addr() {
|
||||
|
||||
kdump_setup_bridge() {
|
||||
local _netdev=$1
|
||||
local _brif=""
|
||||
for _dev in `ls /sys/class/net/$_netdev/brif/`; do
|
||||
if kdump_is_bond "$_dev"; then
|
||||
kdump_setup_bond "$_dev"
|
||||
@ -110,8 +111,9 @@ kdump_setup_bridge() {
|
||||
else
|
||||
echo -n " ifname=$_dev:$(kdump_get_mac_addr $_dev)" >> ${initdir}/etc/cmdline.d/41bridge.conf
|
||||
fi
|
||||
_brif+="$_dev,"
|
||||
done
|
||||
echo " bridge=$_netdev:$(cd /sys/class/net/$_netdev/brif/; echo * | sed -e 's/ /,/g')" >> ${initdir}/etc/cmdline.d/41bridge.conf
|
||||
echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41bridge.conf
|
||||
}
|
||||
|
||||
kdump_setup_bond() {
|
||||
|
Loading…
Reference in New Issue
Block a user