mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 19:49:54 +00:00
Add 'publicip' command to display your public ip address.
This commit is contained in:
12
fetch
12
fetch
@@ -1358,6 +1358,18 @@ getlocalip () {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getpublicip () {
|
||||||
|
if type -p curl >/dev/null 2>&1; then
|
||||||
|
publicip="$(curl -w '\n' http://ident.me)"
|
||||||
|
|
||||||
|
elif type -p wget >/dev/null 2>&1; then
|
||||||
|
publicip="$(wget -qO- http://ident.me; printf "%s")"
|
||||||
|
|
||||||
|
else
|
||||||
|
publicip="Unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Birthday {{{
|
# Birthday {{{
|
||||||
|
|||||||
Reference in New Issue
Block a user