This commit is contained in:
ange 2025-09-02 05:44:14 +00:00
parent 304e61574e
commit 7a2f5d5930
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
24 changed files with 123 additions and 63 deletions

View file

@ -72,8 +72,8 @@ _tz() {
mapfile -t if < <(ip -j route show default | jq -r '.[] | .prefsrc, .dev')
if ! [ -s "$f" ] || [ "${if[0]}" != "$(< ip)" ]; then
echo "${if[0]}" > ip
if j="$(curl -s 'https://ipapi.co/json')"; then
jq -r '.timezone, "\(.latitude):\(.longitude)"' <<< "$j" > "$f"
if j="$(curl -s 'https://api.ipbase.com/v2/info')"; then
jq -r '.[] | .timezone.id, (.location |"\(.latitude):\(.longitude)" )' <<< "$j" > "$f"
head -1 "$f"
fi
else