2021-08-24 18:44:01 +00:00
|
|
|
edit:add-var publicip~ [@argv]{
|
2020-03-13 14:03:36 +00:00
|
|
|
f = [t]{
|
|
|
|
use moi/util/condition
|
2021-08-24 18:44:01 +00:00
|
|
|
t = (condition:cset (eq $t -6) -6 -4)
|
|
|
|
l = (condition:cset (eq $t -6) 'IPv6: ' 'IPv4: ')
|
2020-03-13 14:03:36 +00:00
|
|
|
curl $t ifconfig.co/ip 2> /dev/null | each [ip]{ echo (styled $l bold yellow) $ip }
|
|
|
|
}
|
|
|
|
$f -4
|
|
|
|
$f -6
|
|
|
|
}
|