diff --git a/.bash_aliases b/.bash_aliases index 74b55f9..f46c50e 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -192,3 +192,15 @@ function ramdisk() { sudo mount -t tmpfs -o size="$size" tmpfs "$HOME/ramdown" } + +ipin() { + local ip=$1 + local endpoint="https://ipinfo.io" + # Append IP to the endpoint if provided + if [[ -n $ip ]]; then + endpoint+="/$ip" + fi + endpoint+="/json?token=4ea2457429bf23" + # Make the API call and prettify the JSON response + curl -s "$endpoint" | jq . +}