slitaz-tools rev 958

tazbox: fix possibly problems with geoip
(It ended before with the empty message box with [Yes] [No] buttons)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Nov 12 11:37:45 2015 +0200 (2015-11-12)
parents bffe37afb546
children c6b3e0d9a922
files tazbox/tazbox
line diff
     1.1 --- a/tazbox/tazbox	Sun Nov 08 22:09:10 2015 +0200
     1.2 +++ b/tazbox/tazbox	Thu Nov 12 11:37:45 2015 +0200
     1.3 @@ -154,7 +154,7 @@
     1.4  # Initial Config functions
     1.5  
     1.6  setup_main() {
     1.7 -	icon='locale'
     1.8 +	icon='preferences-desktop-locale'
     1.9  	gen_kmap_list
    1.10  	locale=$(ls -1 $db | grep ^[a-z][a-z]_[A-Z][A-Z] | tr "\n" "!")
    1.11  	keymap=$(cat $tmp | sort | tr "\n" "!")
    1.12 @@ -253,7 +253,9 @@
    1.13  # Response: IP,CountryCode,CountryName, ...
    1.14  
    1.15  geoip() {
    1.16 -	[ ! -e $csv ] && wget -q -T3 -O $csv http://freegeoip.net/csv/ 2&>/dev/null
    1.17 +	# freegeoip.net can be in the blocked hosts list. Return only correct answer or nothing
    1.18 +	[ ! -e $csv ] && wget -q -T3 -O - http://freegeoip.net/csv/ 2&>/dev/null | \
    1.19 +		grep '[0-9.]*,.*,.*,.*,.*,.*,.*,.*,[0-9.]*,[0-9.]*' > $csv
    1.20  	[ -e $csv ] && cut -d, -f2 $csv
    1.21  }
    1.22