Skip to content

Commit

Permalink
Merge pull request #361 from mchf/SLE-12-SP1
Browse files Browse the repository at this point in the history
Improved network interfaces listing
  • Loading branch information
mchf committed Apr 15, 2016
2 parents a8f515e + b8b2ed3 commit fa35639
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Apr 13 07:14:09 UTC 2016 - mfilka@suse.com

- bsc#956473
- improved formatting of network interfaces listing
- 3.1.163.7

-------------------------------------------------------------------
Mon Feb 29 09:05:16 UTC 2016 - mfilka@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.162.6
Version: 3.1.162.7
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
12 changes: 10 additions & 2 deletions startup/common/network.sh
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 -oneline address show | grep "inet" | cut --delimiter=' ' --fields=2 | uniq | grep --invert-match "^lo")

for i in ${ifaces}; do
ip address show $i | sed --quiet \
--expression="1{s/^[^ ]* \([^:]*\).*/\1:/;h}" \
--expression="/ether/{ s/^.*ether[^ ]* \([^ ]*\).*/\1/; H; g; s/\n/ /; p}" \
--expression="s/^[ ]*inet \([^ ]*\).*/ \1/p" \
--expression="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 fa35639

Please sign in to comment.