From ff47473e0b24e13aa5928d4a2fef84256558a539 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 17 Jun 2023 19:10:11 -0500 Subject: [PATCH] My bad --- .bash_aliases | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 . +}