1
0
Fork 0
This commit is contained in:
Arthur K. 2026-01-06 07:36:53 +03:00
parent c449dfcb5f
commit 559939e2f4
Signed by: wzray
GPG key ID: B97F30FDC4636357
49 changed files with 729 additions and 252 deletions

View file

@ -1,6 +1,4 @@
#!/bin/bash -e
set -o pipefail
#!/bin/bash
API_ENDPOINT="http://ip-api.com/json/$1"'?fields='
FIELDS_FULL='7876383'
@ -24,7 +22,7 @@ elif [ -t 1 ]; then
notify-send -i /dev/null "IP Info" "$(get_stats)"
else
if [ -n "$1" ]; then
resp="$(dig +short "$1" | tr -d $'\n')"
resp="$(dig +short "$1" | tail -1 | tr -d $'\n')"
[ -n "$resp" ] && printf "%s" "$resp" || { echo 'Not found!' >&2; exit 1; }
else
curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'