Unofficial client library for ipify: a simple IP address API
MIT License
Unofficial client library for ipify: A Simple IP Address API.
98.207.254.136
{"ip":"98.207.254.136"}
callback({"ip":"98.207.254.136"});
getip({"ip":"98.207.254.136"});
0
1
2
$ curl -O https://raw.githubusercontent.com/xtonousou/ipify.sh/master/ipify.sh
$ source ipify.sh
$ get_ip -h
or
$ source <(curl -s https://raw.githubusercontent.com/xtonousou/ipify.sh/master/ipify.sh) && get_ip -h
COMMAND TYPE OUTPUT
get_ip -h, --help text This help message
get_ip -t, --text text 98.207.254.136
get_ip -j, --json json {"ip":"98.207.254.136"}
get_ip -J, --jsonp jsonp callback({"ip":"98.207.254.136"});
get_ip -g, --get-ip jsonp getip({"ip":"98.207.254.136"});
You can source the script to anywhere and use its function to get the Public IP. Put the following line at the beginning of your script. Of course replace the path with the right one first.
source /path/to/ipify.sh
or
. /path/to/ipify.sh