Xray-install icon indicating copy to clipboard operation
Xray-install copied to clipboard

关于geodata更新问题

Open shandongtlb opened this issue 1 year ago • 12 comments

设置了定时命令来更新该脚本

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install-geodata

请问该脚本更新完毕后还需要重新启动xray服务以确保新dat文件生效吗

shandongtlb avatar Aug 01 '23 02:08 shandongtlb

是的

chika0801 avatar Aug 01 '23 02:08 chika0801

~~https://github.com/KoinuDayo/GeoDataUpdater~~

chise0713 avatar Aug 01 '23 02:08 chise0713

好的,谢谢各位解答!

shandongtlb avatar Aug 01 '23 06:08 shandongtlb

~https://github.com/KoinuDayo/GeoDataUpdater~

收藏了。

@shandongtlb 我是用的一个.sh 定时执行 文件内容是curl 下载 下载完重启下xray

chika0801 avatar Aug 01 '23 08:08 chika0801

~https://github.com/KoinuDayo/GeoDataUpdater~

收藏了。

@shandongtlb 我是用的一个.sh 定时执行 文件内容是curl 下载 下载完重启下xray

谢谢!

shandongtlb avatar Aug 01 '23 16:08 shandongtlb

printf "0 7 * * * /root/update_geodata.sh\n" > update && crontab update && rm update && printf "#\041/usr/bin/env bash\ncurl -sLo /usr/local/share/xray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat\ncurl -sLo /usr/local/share/xray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat\nsystemctl restart xray\n" > update_geodata.sh && chmod +x update_geodata.sh

毫无技术的自己方便用的一行版

chika0801 avatar Aug 01 '23 16:08 chika0801

printf "0 7 * * * /root/update_geodata.sh\n" > update && crontab update && rm update && printf "#\041/usr/bin/env bash\ncurl -sLo /usr/local/share/xray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat\ncurl -sLo /usr/local/share/xray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat\nsystemctl restart xray\n" > update_geodata.sh && chmod +x update_geodata.sh

毫无技术的自己方便用的一行版

本人牛角尖+强迫症

0 4 * * * bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install-geodata

只更新,不重启,生怕某天在用的时候重启被断掉(道理都明白,就是强迫症)

shandongtlb avatar Aug 02 '23 14:08 shandongtlb

你这个大写的服呀

chika0801 avatar Aug 03 '23 00:08 chika0801

printf "0 7 * * * /root/update_geodata.sh\n" > update && crontab update && rm update && printf "#\041/usr/bin/env bash\ncurl -sLo /usr/local/share/xray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat\ncurl -sLo /usr/local/share/xray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat\nsystemctl restart xray\n" > update_geodata.sh && chmod +x update_geodata.sh

毫无技术的自己方便用的一行版

一行版执行完了还需要sh update_geodata.sh吗

misakaok avatar Aug 17 '23 08:08 misakaok

一行版执行完了还需要sh update_geodata.sh吗

看了下,它这是定时自动执行,你用完一行可以直接不管它,到时间会自己执行的

chise0713 avatar Aug 17 '23 08:08 chise0713

@KoinuDayo 好的 谢谢

misakaok avatar Aug 17 '23 08:08 misakaok

只更新,不重启,生怕某天在用的时候重启被断掉(道理都明白,就是强迫症)

你这句话给了我灵感,我在我的那个脚本内加入了个判断https://github.com/KoinuDayo/GeoDataUpdater/commit/490d7d81be314f45ad7ead71b98741e5d3042246 这样上游没更新就不会重启了

chise0713 avatar Aug 20 '23 00:08 chise0713

其实有没有一个类似于 xray reload 的指令,可以重新载入这一类会更新的东西?

印象中也有程序在收到SIGHUP之后重新载入外部资料,也有利用systemctl reload xxx.service的。

SodaWithoutSparkles avatar Apr 05 '24 11:04 SodaWithoutSparkles