XTLS / Xray-install

Easiest way to install & upgrade Xray.
https://t.me/projectXray
GNU General Public License v3.0
1.8k stars 475 forks source link

关于geodata更新问题 #63

Closed shandongtlb closed 5 months ago

shandongtlb commented 1 year ago

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

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

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

chika0801 commented 1 year ago

是的

chise0713 commented 1 year ago

https://github.com/KoinuDayo/GeoDataUpdater

shandongtlb commented 1 year ago

好的,谢谢各位解答!

chika0801 commented 1 year ago

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

收藏了。

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

shandongtlb commented 1 year ago

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

收藏了。

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

谢谢!

chika0801 commented 1 year ago
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

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

shandongtlb commented 1 year ago
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

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

chika0801 commented 1 year ago

你这个大写的服呀

cheneyxx commented 1 year ago
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吗

chise0713 commented 1 year ago

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

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

cheneyxx commented 1 year ago

@KoinuDayo 好的 谢谢

chise0713 commented 1 year ago

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

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

SodaWithoutSparkles commented 6 months ago

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

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