Skip to content

Commit

Permalink
Fixed separating ip address to be correct on debian jessie systems
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxe18 committed Jun 25, 2019
1 parent 45b1161 commit 712d31f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions custom-motd/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
custom-motd (1.0.2) unstable; urgency=medium

* Fixed separating ip address to be correct on debian jessie systems

-- Haxe18 <Haxe18> Tue, 25 Jun 2019 23:24:39 +0200

custom-motd (1.0.1) unstable; urgency=medium

* Done some fixes for displaying server ip(s) on debian stretch or newer
Expand Down
4 changes: 2 additions & 2 deletions custom-motd/files/etc/update-motd.d/10-sysinfo
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ IFS=$IFS_ORG
zvi4=0
zvi6=0
for i in $interfaces; do
tmp4=$(/sbin/ifconfig $i | grep -o -E 'inet.[a-zA-Z]*:?[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | awk '{print $NF}')
tmp6=$(/sbin/ifconfig $i | grep -o -Ei 'inet6.[a-zA-Z]*:? *[0-9a-f:]+' | grep -v fe80 | awk '{print $NF}')
tmp4=$(/sbin/ifconfig $i | grep -o -E 'inet.[a-zA-Z]*:?[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -Eo '[0-9\.]+')
tmp6=$(/sbin/ifconfig $i | grep -o -Ei 'inet6.[a-zA-Z]*:? *[0-9a-f:]+' | grep -v fe80 | grep -Eo '[0-9a-z]+:[0-9\.\:a-z]+')

if [ -n "$tmp4" ]; then #IF IP da
ifn4[$zvi4]=$(echo $i)
Expand Down

0 comments on commit 712d31f

Please sign in to comment.