Thanks for the share, although I did notice one issue and I didn't know if you wanted me to create a github issue for it or not.
It looks like you're referencing the file
/opt/MaxMind/GeoLiteCity.dat but if a user doesn't have this file, your script would break.
Do you mind either attaching this file to your post, updating your code to make it check for the GeoLiteCity.dat file and download it or tell the user how to download it, or just posting in this topic how/where to get it? IIRC this file is included in Kali installs but not everyone may be running Kali.