use built-ins, close #1297
This commit is contained in:
parent
5a6c56d565
commit
b719590427
1 changed files with 8 additions and 3 deletions
|
@ -5,6 +5,11 @@
|
||||||
#
|
#
|
||||||
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
||||||
|
|
||||||
ifinstalled "geoip" || exit
|
set -e
|
||||||
addr="$(curl ifconfig.me 2>/dev/null)" || exit
|
|
||||||
grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"
|
ifinstalled "geoip"
|
||||||
|
addr="$(geoiplookup "$(curl -sfm 1 ifconfig.me 2>/dev/null)")"
|
||||||
|
name="${addr##*, }"
|
||||||
|
flag="$(grep "flag: $name" "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji")"
|
||||||
|
flag="${flag%% *}"
|
||||||
|
printf "%s %s\\n" "$flag" "$name"
|
||||||
|
|
Loading…
Reference in a new issue