Skip to content

Instantly share code, notes, and snippets.

@NikoTung
Last active January 4, 2024 15:06
Show Gist options
  • Save NikoTung/d250b6fa8ced67b5ea7f8387c5fe7016 to your computer and use it in GitHub Desktop.
Save NikoTung/d250b6fa8ced67b5ea7f8387c5fe7016 to your computer and use it in GitHub Desktop.
geoip-cn
#!/bin/bash
#
## From https://github.com/Loyalsoldier/geoip 少了 MaxMind GeoLite2
# 主要是给mosdns 用,text 格式
urls=("https://raw.githubusercontent.com/gaoyifan/china-operator-ip/ip-lists/china6.txt" "https://raw.githubusercontent.com/gaoyifan/china-operator-ip/ip-lists/china.txt" "https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt")
## Download each file
for url in "${urls[@]}"; do
wget -P .temp/ "$url"
done
# Merge the files
cat .temp/china_ip_list.txt .temp/china.txt .temp/china6.txt > geoip-cn.txt
rm -rf .temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment