Skip to content

China IP list

China IP list #243

Workflow file for this run

name: China IP list
on:
# push:
# branches:
# - master
watch:
types: started
schedule:
- cron: 0 4 * * *
workflow_dispatch:
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id
runs-on: Ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set git identity
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Combine
run: |
misakaio="$(curl -kLfsm 5 https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt)"
mayax="$(curl -kLfsm 5 https://raw.githubusercontent.com/mayaxcn/china-ip-list/master/chnroute.txt)"
qqwry="$(curl -kLfsm 5 https://raw.githubusercontent.com/metowolf/iplist/master/data/special/china.txt)"
ipipnet="$(curl -kLfsm 5 https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt)"
gaoyifan="$(curl -kLfsm 5 https://raw.githubusercontent.com/gaoyifan/china-operator-ip/ip-lists/china.txt)"
clang="$(curl -kLfsm 5 https://ispip.clang.cn/all_cn.txt)"
echo "$misakaio" > output.txt
grep -v '#' output.txt > new_output.txt
misakaio2="$(cat new_output.txt)"
biglist="$qqwry\n$ipipnet\n$clang\n$misakaio2\n$mayax\n$gaoyifan"
echo -e "${biglist}" | sort | uniq > merger.txt
- name: Download Setup
run: |
if [ -f cidr-merger-linux-amd64 ]; then
echo "File exists"
else
wget https://github.com/zhanhb/cidr-merger/releases/download/v1.1.3/cidr-merger-linux-amd64
fi
- name: merger file
run: |
chmod +x cidr-merger-linux-amd64
./cidr-merger-linux-amd64 merger.txt > china_ip_list.txt
rm output.txt
rm new_output.txt
- name: Apply
run: |
Emoji=("πŸŽ‰" "🀞" "✨" "🎁" "🎈" "πŸŽ„" "🎨" "πŸ“" "πŸ•" "πŸ‰" "πŸ’" "🌴" "πŸš€" "πŸ›Έ" "πŸ—½" "β›…" "🌈" "πŸ”₯" "β›„" "🐢" "πŸ…" "πŸ¦„" "🐀")
git add .
git commit -m "${Emoji[$[$RANDOM % ${#Emoji[@]}]]} Sync $(date +%Y-%m-%d" "%H:%M:%S)"
git push -f -u origin main