Skip to content

Commit

Permalink
Changed formating of IP addresses listing. bnc#956473
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Apr 15, 2016
1 parent 60dacad commit 21ac71c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions startup/common/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ function list_ifaces()
# list network interfaces
# - all active ones with all IPv4 / IPv6 addresses
# - excluding loopback device
/sbin/ip -o a s | grep "inet" | cut -d' ' -f2 | uniq | grep -v "^lo" | xargs -n1 -d'\n' /sbin/ip a s
ifaces=$(/sbin/ip -o a s | grep "inet" | cut -d' ' -f2 | uniq | grep -v "^lo")

for i in ${ifaces}; do
ip a s $i | sed -n \
-e "1{s/^[^ ]* \([^:]*\).*/\1:/;h}" \
-e "/ether/{ s/^.*ether[^ ]* \([^ ]*\).*/\1/; H; g; s/\n/ /; p}" \
-e "s/^[ ]*inet \([^ ]*\).*/ \1/p" \
-e "s/^[ ]*inet6 \([^ ]*\).*/ \1/p"
done;
}


Expand Down Expand Up @@ -77,7 +85,7 @@ function ssh_message () {
you can login now and proceed with the installation
run the command 'yast.ssh'
active interfaces:
These network addresses are available:
EOF
list_ifaces
Expand Down

0 comments on commit 21ac71c

Please sign in to comment.