This commit is contained in:
Brad Ganley 2023-06-17 19:10:11 -05:00
parent 7fa5fccedf
commit ff47473e0b

View File

@ -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 .
}