Skip to content

DBIP account #31

Answered by Seb-a320
Seb-a320 asked this question in Q&A
Jun 9, 2023 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hello and thank you for the response. I am not a developer, but in the meantime, this works :

replacing download_db with

fichier=`curl -s 'https://db-ip.com/account/xxxxxxxxxxxxxxxxxxxxxxxxxxx/db/ip-to-country/' | jq -r '.csv.name'`
url=`curl -s 'https://db-ip.com/account/xxxxxxxxxxxxxxxxxxxxxxxxxxx/db/ip-to-country/' | jq -r '.csv.url'`

wget -O $fichier $url
gunzip $fichier

while IFS=, read -r f1 f2 f3 f4
do
  printf  "$f1,$f2,$f4\n" >> test.csv
done < "$dbip_filename"

rm $dbip_filename
mv test.csv $dbip_filename

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wirefalls
Comment options

Answer selected by wirefalls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants