mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-03-05 15:43:06 +00:00
Compare commits
No commits in common. "c0372ed84d453595c96444feb8fd6ab277d8ee33" and "b4db9e2c5d62d1281bc71d3363f5b5ad8dc48767" have entirely different histories.
c0372ed84d
...
b4db9e2c5d
1 changed files with 21 additions and 16 deletions
37
x-ui.sh
37
x-ui.sh
|
|
@ -873,21 +873,24 @@ delete_ports() {
|
||||||
}
|
}
|
||||||
|
|
||||||
update_all_geofiles() {
|
update_all_geofiles() {
|
||||||
update_geofiles "main"
|
update_main_geofiles
|
||||||
update_geofiles "IR"
|
update_ir_geofiles
|
||||||
update_geofiles "RU"
|
update_ru_geofiles
|
||||||
}
|
}
|
||||||
|
|
||||||
update_geofiles() {
|
update_main_geofiles() {
|
||||||
case "${1}" in
|
curl -fLRo geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
"main") dat_files=(geoip geosite); dat_source="Loyalsoldier/v2ray-rules-dat";;
|
curl -fLRo geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
"IR") dat_files=(geoip_IR geosite_IR); dat_source="chocolate4u/Iran-v2ray-rules" ;;
|
}
|
||||||
"RU") dat_files=(geoip_RU geosite_RU); dat_source="runetfreedom/russia-v2ray-rules-dat";;
|
|
||||||
esac
|
update_ir_geofiles() {
|
||||||
for dat in "${dat_files[@]}"; do
|
curl -fLRo geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
|
||||||
curl -fLRo ${xui_folder}/bin/${dat}.dat -z ${xui_folder}/bin/${dat}.dat \
|
curl -fLRo geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
|
||||||
https://github.com/${dat_source}/releases/latest/download/${dat%%_}.dat
|
}
|
||||||
done
|
|
||||||
|
update_ru_geofiles() {
|
||||||
|
curl -fLRo geoip_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
|
curl -fLRo geosite_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
}
|
}
|
||||||
|
|
||||||
update_geo() {
|
update_geo() {
|
||||||
|
|
@ -898,22 +901,24 @@ update_geo() {
|
||||||
echo -e "${green}\t0.${plain} Back to Main Menu"
|
echo -e "${green}\t0.${plain} Back to Main Menu"
|
||||||
read -rp "Choose an option: " choice
|
read -rp "Choose an option: " choice
|
||||||
|
|
||||||
|
cd ${xui_folder}/bin
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
0)
|
0)
|
||||||
show_menu
|
show_menu
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
update_geofiles "main"
|
update_main_geofiles
|
||||||
echo -e "${green}Loyalsoldier datasets have been updated successfully!${plain}"
|
echo -e "${green}Loyalsoldier datasets have been updated successfully!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
update_geofiles "IR"
|
update_ir_geofiles
|
||||||
echo -e "${green}chocolate4u datasets have been updated successfully!${plain}"
|
echo -e "${green}chocolate4u datasets have been updated successfully!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
update_geofiles "RU"
|
update_ru_geofiles
|
||||||
echo -e "${green}runetfreedom datasets have been updated successfully!${plain}"
|
echo -e "${green}runetfreedom datasets have been updated successfully!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue