2021-12-11 21:09:02 +00:00
|
|
|
edit:add-var publicip~ {|@argv|
|
2021-12-27 17:54:26 +00:00
|
|
|
use framagit.org/benjamin.vaudour/elv-lib/mods/common
|
2021-12-11 21:09:02 +00:00
|
|
|
var f = {|t|
|
2020-03-13 14:03:36 +00:00
|
|
|
use moi/util/condition
|
2021-12-27 17:54:26 +00:00
|
|
|
set t = (common:cond (eq $t -6) -6 -4)
|
|
|
|
var l = (common:cond (eq $t -6) 'IPv6: ' 'IPv4: ')
|
|
|
|
e:curl $t ifconfig.co/ip 2> /dev/null | each {|ip| echo (styled $l bold yellow) $ip}
|
2020-03-13 14:03:36 +00:00
|
|
|
}
|
|
|
|
$f -4
|
|
|
|
$f -6
|
|
|
|
}
|