#!/bin/bash set -e FastGit="https://hub.fastgit.org/Loyalsoldier/v2ray-rules-dat/releases/latest/" GitHub="https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/" JsDelivr="https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/" download_files() { echo "Fetching geoip.dat" curl -LO "${1}/geoip.dat" echo "Fetching geosite.dat" curl -LO "${1}/geosite.dat" } case "${1}" in "fastgit" | "fg") download_files $FastGit ;; "jsdelivr" | "js") download_files $JsDelivr ;; *) download_files $GitHub ;; esac