download_dbs.sh 988 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # 设置文件目录和版本文件
  3. FILE_DIR="../database"
  4. VERSION_FILE="$FILE_DIR/version.json"
  5. # 引入下载工具函数
  6. source ./download_utils.sh
  7. # 检查并安装依赖软件包
  8. check_and_install jq
  9. # 定义数据库信息
  10. declare -Ag docs
  11. # 设置数据库信息
  12. docs[geo_lite_name]="GeoLite2-City.mmdb"
  13. docs[geo_lite_version]=$(get_tag "P3TERX/GeoLite.mmdb")
  14. docs[geo_lite_url]="https://github.com/P3TERX/GeoLite.mmdb/releases/download/${docs[geo_lite_version]}/GeoLite2-City.mmdb"
  15. docs[ip2location_name]="IP2LOCATION-LITE-DB11.IPV6.BIN"
  16. docs[ip2location_version]=$(get_tag "renfei/ip2location")
  17. docs[ip2location_url]="https://github.com/renfei/ip2location/releases/download/${docs[ip2location_version]}/IP2LOCATION-LITE-DB11.IPV6.BIN"
  18. docs[qqwry_name]="qqwry.ipdb"
  19. docs[qqwry_version]=$(get_tag "metowolf/qqwry.dat")
  20. docs[qqwry_url]="https://cdn.jsdelivr.net/npm/qqwry.ipdb/qqwry.ipdb"
  21. # 处理文件下载
  22. process_files
  23. echo -e "\e[32mUpdate completed!\e[0m"