ulthar.xyz > Repos

dotfiles

Seven years worth of accumulated configuration cruft
About Files Commits git clone https://ulthar.xyz/repos/dotfiles/dotfiles.git

dotfiles/scripts/.local/bin/iploc

Download raw file: scripts/.local/bin/iploc

#!/bin/sh

if [ "$#" = 0 ]; then
	printf 'localhost '
	curl --no-progress-meter https://ipinfo.io \
		| jq -rj '"(", .ip, "): ", .city, ", ", .region, "\n"'
else
	dig "$1" +short | while read -r ip; do
		printf '%s (%s): ' "$1" "$ip"
		curl --no-progress-meter "https://ipinfo.io/$ip" \
			| jq -rj '.city, ", ", .region, "\n"'
	done
fi
Generated 2025-03-07 15:24:27 -0700 by RepoRat