updatedat.sh 665 B

123456789101112131415
  1. #!/bin/bash
  2. pushd "$GOPATH/src/v2ray.com/core/" || return
  3. # Update geoip.dat
  4. GEOIP_TAG=$(curl --silent "https://api.github.com/repos/v2ray/geoip/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
  5. curl -L -o release/config/geoip.dat "https://github.com/v2ray/geoip/releases/download/${GEOIP_TAG}/geoip.dat"
  6. sleep 1
  7. # Update geosite.dat
  8. GEOSITE_TAG=$(curl --silent "https://api.github.com/repos/v2ray/domain-list-community/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
  9. curl -L -o release/config/geosite.dat "https://github.com/v2ray/domain-list-community/releases/download/${GEOSITE_TAG}/dlc.dat"
  10. sleep 1
  11. popd || return