mirror of https://github.com/dler-io/Rules.git
Auto Update China IPs
parent
97de6b53d8
commit
5c944ce62b
@ -0,0 +1,29 @@
|
||||
name: Auto Update China IPs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Update IPs
|
||||
run: |
|
||||
wget -c http://ftp.apnic.net/stats/apnic/delegated-apnic-latest
|
||||
cat delegated-apnic-latest | awk -F '|' '/CN/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' > raw_ips.txt
|
||||
echo "# > Domestic IPs" > Surge/Surge 3/Provider/Domestic IPs.list
|
||||
echo "payload:" > Clash/Provider/Domestic IPs.yaml
|
||||
cat raw_ips.txt | awk '{print "IP-CIDR,"$1",no-resolve"}' >> Surge/Surge 3/Provider/Domestic IPs.list
|
||||
cat raw_ips.txt | awk '{print " - "$1}' >> Clash/Provider/Domestic IPs.yaml
|
||||
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config --global user.email "actions@github.com"
|
||||
git config --global user.name "GitHub Action"
|
||||
git add .
|
||||
git commit -m "Update China IPs"
|
||||
git push
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue