summarylogtreecommitdiffstats
path: root/vxray-rules-dat-updater
diff options
context:
space:
mode:
authorzswdcx2021-08-22 17:49:43 +0800
committerzswdcx2021-08-22 17:49:43 +0800
commit81083e2634ae6f535cb864f200e183416c18db05 (patch)
tree3702d889ee6b367d81d3eb569b7395af45505448 /vxray-rules-dat-updater
downloadaur-81083e2634ae6f535cb864f200e183416c18db05.tar.gz
ver1-1
Diffstat (limited to 'vxray-rules-dat-updater')
-rwxr-xr-xvxray-rules-dat-updater27
1 files changed, 27 insertions, 0 deletions
diff --git a/vxray-rules-dat-updater b/vxray-rules-dat-updater
new file mode 100755
index 00000000000..6a245de27f9
--- /dev/null
+++ b/vxray-rules-dat-updater
@@ -0,0 +1,27 @@
+#!/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