diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-05-29 09:30:16 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-05-29 09:30:16 +1000 |
commit | c7ab35efc857a47bffac029f10a741f37d1431e9 (patch) | |
tree | 1beaee20815dfcadf368c7e581e2fec54165aa5e /tools | |
parent | ae803c0c8d2bb1f9e51b868b5a00a15057dfd298 (diff) | |
parent | a3995460491d4570af8e99ad34ddf6d1948254d9 (diff) |
Merge remote-tracking branch 'net-next/master'
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/hv/bondvf.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/hv/bondvf.sh b/tools/hv/bondvf.sh index d85968cb1bf2..112deba8c4e9 100755 --- a/tools/hv/bondvf.sh +++ b/tools/hv/bondvf.sh @@ -102,15 +102,30 @@ function create_bond_cfg_redhat { } function del_eth_cfg_ubuntu { - local fn=$cfgdir/interfaces + local mainfn=$cfgdir/interfaces + local fnlist=( $mainfn ) + + local dirlist=(`awk '/^[ \t]*source/{print $2}' $mainfn`) + + local i + for i in "${dirlist[@]}" + do + fnlist+=(`ls $i 2>/dev/null`) + done + local tmpfl=$(mktemp) local nic_start='^[ \t]*(auto|iface|mapping|allow-.*)[ \t]+'$1 local nic_end='^[ \t]*(auto|iface|mapping|allow-.*|source)' - awk "/$nic_end/{x=0} x{next} /$nic_start/{x=1;next} 1" $fn >$tmpfl + local fn + for fn in "${fnlist[@]}" + do + awk "/$nic_end/{x=0} x{next} /$nic_start/{x=1;next} 1" \ + $fn >$tmpfl - cp $tmpfl $fn + cp $tmpfl $fn + done rm $tmpfl } |