Skip to content

Commit

Permalink
Done some fixes for displaying server ip(s) on debian stretch or newe…
Browse files Browse the repository at this point in the history
…r + Disable display kernel version @ login twice at some distros
  • Loading branch information
Haxe18 committed Jan 28, 2019
1 parent 3fa6060 commit 45b1161
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions custom-motd/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
custom-motd (1.0.1) unstable; urgency=medium

* Done some fixes for displaying server ip(s) on debian stretch or newer
* Disable display kernel version @ login twice at some distros

-- Haxe18 <Haxe18> Mon, 28 Jan 2019 21:16:28 +0100

custom-motd (1.0.0) unstable; urgency=medium

* Initial Release.
Expand Down
3 changes: 3 additions & 0 deletions custom-motd/debian/postinst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
rm /etc/motd
ln -sf /var/run/motd /etc/motd
if [ -f /etc/update-motd.d/10-uname ];then
chmod 444 /etc/update-motd.d/10-uname
fi
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 -F':' '{print $2}')
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}' | awk '{print $NF}')
tmp6=$(/sbin/ifconfig $i | grep -o -Ei 'inet6.[a-zA-Z]*:? *[0-9a-f:]+' | grep -v fe80 | awk '{print $NF}')

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

0 comments on commit 45b1161

Please sign in to comment.