Correct parsing of geoiplookup parsing for country with multiple words. - annna… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit e7ee8fbf426b5c199e8a739079cbe60b58794727 | |
parent 0dd6e338e5a40ac7c476cf09147cae25755137a6 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sat, 14 Nov 2020 15:55:13 +0100 | |
Correct parsing of geoiplookup parsing for country with multiple words. | |
Diffstat: | |
M locate-cake-hater | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/locate-cake-hater b/locate-cake-hater | |
@@ -7,11 +7,11 @@ port="$2" | |
case "$ip" in | |
*:*) | |
- country="$(geoiplookup6 "$ip" | awk '{print $NF}')" | |
+ country="$(geoiplookup6 "$ip" | sed 's:.*, ::')" | |
ip="[$ip]" | |
;; | |
*) | |
- country="$(geoiplookup "$ip" | awk '{print $NF}')" | |
+ country="$(geoiplookup "$ip" | sed 's:.*, ::')" | |
;; | |
esac | |