elvish_config/aliases/publicip.elv
2021-08-24 20:44:01 +02:00

11 lines
276 B
Plaintext

edit:add-var publicip~ [@argv]{
f = [t]{
use moi/util/condition
t = (condition:cset (eq $t -6) -6 -4)
l = (condition:cset (eq $t -6) 'IPv6: ' 'IPv4: ')
curl $t ifconfig.co/ip 2> /dev/null | each [ip]{ echo (styled $l bold yellow) $ip }
}
$f -4
$f -6
}