mirror of
https://gitlab.com/mattia.basaglia/ASCII-Pony.git
synced 2024-11-22 04:07:59 +01:00
IP interface variable and split IPv6
This commit is contained in:
parent
b87969a264
commit
e1bdaa6bfe
1 changed files with 9 additions and 1 deletions
10
systempony
10
systempony
|
@ -7,6 +7,8 @@ PONY=random
|
|||
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)
|
||||
FSTYPE=
|
||||
# Interface to get the IP address from
|
||||
IP_INTERFACE="eth0"
|
||||
|
||||
function ponyget_Shell()
|
||||
{
|
||||
|
@ -137,7 +139,13 @@ function ponyget_Containers()
|
|||
|
||||
function ponyget_IP()
|
||||
{
|
||||
ip -o addr | grep -vE "lo\s+inet" | grep -Po "inet6?\s*\K[^/]+" | xargs echo
|
||||
[ -z "$1" ] && inet="inet" || inet="$1"
|
||||
ip -o addr | grep -vE "lo\s+inet" | grep -F "$IP_INTERFACE" | grep -Po "$inet\s+\K[^/]+" | xargs echo
|
||||
}
|
||||
|
||||
function ponyget_IPv6()
|
||||
{
|
||||
ponyget_IP inet6
|
||||
}
|
||||
|
||||
function bold()
|
||||
|
|
Loading…
Reference in a new issue