This commit is contained in:
Dryusdan 2020-06-30 16:58:08 +02:00
parent 8e03a07395
commit e0b1ba8adb
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#!/bin/sh
. /etc/update-motd.d/colors
default_iface=$(route | grep default | awk '{ print $8 }')
ip=$(ip a | grep -A 2 $default_iface: | grep inet | awk '{print $2}')
time=$(uptime | grep -ohe 'up .*' | sed 's/,/\ hours/g' | awk '{printf $2" "$3 }')
printf "IP Address:\t%s\n" $ip
printf "System uptime:\t%s\n" "$time"