From 712d31fcf424451acfe78372ad7d7a403a7a70fa Mon Sep 17 00:00:00 2001 From: Haxe18 Date: Tue, 25 Jun 2019 23:39:56 +0200 Subject: [PATCH] Fixed separating ip address to be correct on debian jessie systems --- custom-motd/debian/changelog | 6 ++++++ custom-motd/files/etc/update-motd.d/10-sysinfo | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/custom-motd/debian/changelog b/custom-motd/debian/changelog index 210fab0..19b7307 100644 --- a/custom-motd/debian/changelog +++ b/custom-motd/debian/changelog @@ -1,3 +1,9 @@ +custom-motd (1.0.2) unstable; urgency=medium + + * Fixed separating ip address to be correct on debian jessie systems + + -- 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 diff --git a/custom-motd/files/etc/update-motd.d/10-sysinfo b/custom-motd/files/etc/update-motd.d/10-sysinfo index 143e035..ef6916f 100755 --- a/custom-motd/files/etc/update-motd.d/10-sysinfo +++ b/custom-motd/files/etc/update-motd.d/10-sysinfo @@ -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)