diff options
Diffstat (limited to 'tools/examples/network')
-rwxr-xr-x | tools/examples/network | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/examples/network b/tools/examples/network index b679b93e43..229881d737 100755 --- a/tools/examples/network +++ b/tools/examples/network @@ -61,13 +61,13 @@ transfer_addrs () { local src=$1 local dst=$2 # Don't bother if $dst already has IP addresses. - if ip addr show dev ${dst} | egrep -q '^ *inet' ; then + if ip addr show dev ${dst} | egrep -q '^ *inet ' ; then return fi # Address lines start with 'inet' and have the device in them. # Replace 'inet' with 'ip addr add' and change the device name $src # to 'dev $src'. Remove netmask as we'll add routes later. - ip addr show dev ${src} | egrep '^ *inet' | sed -e " + ip addr show dev ${src} | egrep '^ *inet ' | sed -e " s/inet/ip addr add/ s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)/[0-9]\+@\1@ s/${src}/dev ${dst}/ |