Show IP addresses

This commit is contained in:
Mattia Basaglia 2016-05-18 22:04:22 +01:00
parent d1f3e33715
commit b87969a264

View file

@ -4,7 +4,7 @@
# Name of the pony # Name of the pony
PONY=random PONY=random
# What info to show (must have a function defined as ponyget_* to work) # What info to show (must have a function defined as ponyget_* to work)
INFO=(User Hostname Distro Kernel Uptime Load Shell Packages RAM Swap Disk) INFO=(User Hostname IP Distro Kernel Uptime Load Shell Packages RAM Swap Disk)
# File system type to show disk usage (default/empty=all) (see df for specific values) # File system type to show disk usage (default/empty=all) (see df for specific values)
FSTYPE= FSTYPE=
@ -135,6 +135,11 @@ function ponyget_Containers()
echo -e "\x1b[$color;1m$active\x1b[0m / $total active" echo -e "\x1b[$color;1m$active\x1b[0m / $total active"
} }
function ponyget_IP()
{
ip -o addr | grep -vE "lo\s+inet" | grep -Po "inet6?\s*\K[^/]+" | xargs echo
}
function bold() function bold()
{ {
echo -en "\x1b[1m${*}\x1b[22m" echo -en "\x1b[1m${*}\x1b[22m"