first-commit
This commit is contained in:
25
v2ray示例/旁路由-透明代理/Xray透明代理配置/更新geoip的脚本.sh
Normal file
25
v2ray示例/旁路由-透明代理/Xray透明代理配置/更新geoip的脚本.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
LogPath=/var/log/xray/geoip_update.log
|
||||
|
||||
|
||||
rm -rf /usr/local/share/xray/geosite.dat
|
||||
rm -rf /usr/local/share/xray/geoip.dat
|
||||
echo "current time is $(date), start to update geo ip for xray" >> $LogPath
|
||||
|
||||
curl --connect-timeout 5 -s -o /dev/null https://www.google.com
|
||||
if [[ $? -eq 0 ]];then
|
||||
echo "start to download from github !"
|
||||
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -O /usr/local/share/xray/geosite.dat
|
||||
|
||||
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -O /usr/local/share/xray/geoip.dat
|
||||
else
|
||||
echo "start to download from jsdelivr !"
|
||||
wget https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -O /usr/local/share/xray/geosite.dat
|
||||
|
||||
wget https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat -O /usr/local/share/xray/geoip.dat
|
||||
fi
|
||||
|
||||
|
||||
echo "start to restrat xray !" >> $LogPath
|
||||
systemctl restart xray
|
||||
Reference in New Issue
Block a user