mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 02:42:51 +00:00
Compare commits
2 commits
b8009d9694
...
2041b226e4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2041b226e4 | ||
|
|
cf38226b5d |
3 changed files with 54 additions and 44 deletions
|
|
@ -255,7 +255,7 @@ install_x-ui() {
|
||||||
│ ${blue}x-ui log${plain} - Check logs │
|
│ ${blue}x-ui log${plain} - Check logs │
|
||||||
│ ${blue}x-ui banlog${plain} - Check Fail2ban ban logs │
|
│ ${blue}x-ui banlog${plain} - Check Fail2ban ban logs │
|
||||||
│ ${blue}x-ui update${plain} - Update │
|
│ ${blue}x-ui update${plain} - Update │
|
||||||
│ ${blue}x-ui legacy${plain} - legacy version │
|
│ ${blue}x-ui legacy${plain} - Legacy version │
|
||||||
│ ${blue}x-ui install${plain} - Install │
|
│ ${blue}x-ui install${plain} - Install │
|
||||||
│ ${blue}x-ui uninstall${plain} - Uninstall │
|
│ ${blue}x-ui uninstall${plain} - Uninstall │
|
||||||
└───────────────────────────────────────────────────────┘"
|
└───────────────────────────────────────────────────────┘"
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ update_x-ui() {
|
||||||
│ ${blue}x-ui log${plain} - Check logs │
|
│ ${blue}x-ui log${plain} - Check logs │
|
||||||
│ ${blue}x-ui banlog${plain} - Check Fail2ban ban logs │
|
│ ${blue}x-ui banlog${plain} - Check Fail2ban ban logs │
|
||||||
│ ${blue}x-ui update${plain} - Update │
|
│ ${blue}x-ui update${plain} - Update │
|
||||||
│ ${blue}x-ui legacy${plain} - legacy version │
|
│ ${blue}x-ui legacy${plain} - Legacy version │
|
||||||
│ ${blue}x-ui install${plain} - Install │
|
│ ${blue}x-ui install${plain} - Install │
|
||||||
│ ${blue}x-ui uninstall${plain} - Uninstall │
|
│ ${blue}x-ui uninstall${plain} - Uninstall │
|
||||||
└───────────────────────────────────────────────────────┘"
|
└───────────────────────────────────────────────────────┘"
|
||||||
|
|
|
||||||
64
x-ui.sh
64
x-ui.sh
|
|
@ -863,10 +863,32 @@ delete_ports() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_all_geofiles() {
|
||||||
|
update_main_geofiles
|
||||||
|
update_ir_geofiles
|
||||||
|
update_ru_geofiles
|
||||||
|
}
|
||||||
|
|
||||||
|
update_main_geofiles() {
|
||||||
|
wget -O geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
|
wget -O geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
|
}
|
||||||
|
|
||||||
|
update_ir_geofiles() {
|
||||||
|
wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
|
||||||
|
wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
|
||||||
|
}
|
||||||
|
|
||||||
|
update_ru_geofiles() {
|
||||||
|
wget -O geoip_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
|
wget -O geosite_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
|
}
|
||||||
|
|
||||||
update_geo() {
|
update_geo() {
|
||||||
echo -e "${green}\t1.${plain} Loyalsoldier (geoip.dat, geosite.dat)"
|
echo -e "${green}\t1.${plain} Loyalsoldier (geoip.dat, geosite.dat)"
|
||||||
echo -e "${green}\t2.${plain} chocolate4u (geoip_IR.dat, geosite_IR.dat)"
|
echo -e "${green}\t2.${plain} chocolate4u (geoip_IR.dat, geosite_IR.dat)"
|
||||||
echo -e "${green}\t3.${plain} runetfreedom (geoip_RU.dat, geosite_RU.dat)"
|
echo -e "${green}\t3.${plain} runetfreedom (geoip_RU.dat, geosite_RU.dat)"
|
||||||
|
echo -e "${green}\t4.${plain} All"
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -877,41 +899,25 @@ update_geo() {
|
||||||
show_menu
|
show_menu
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
if [[ $release == "alpine" ]]; then
|
update_main_geofiles
|
||||||
rc-service x-ui stop
|
|
||||||
else
|
|
||||||
systemctl stop x-ui
|
|
||||||
fi
|
|
||||||
rm -f geoip.dat geosite.dat
|
|
||||||
wget -N https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
|
||||||
wget -N https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
|
|
||||||
echo -e "${green}Loyalsoldier datasets have been updated successfully!${plain}"
|
echo -e "${green}Loyalsoldier datasets have been updated successfully!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
if [[ $release == "alpine" ]]; then
|
update_ir_geofiles
|
||||||
rc-service x-ui stop
|
|
||||||
else
|
|
||||||
systemctl stop x-ui
|
|
||||||
fi
|
|
||||||
rm -f geoip_IR.dat geosite_IR.dat
|
|
||||||
wget -O geoip_IR.dat -N https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
|
|
||||||
wget -O geosite_IR.dat -N https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
|
|
||||||
echo -e "${green}chocolate4u datasets have been updated successfully!${plain}"
|
echo -e "${green}chocolate4u datasets have been updated successfully!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
if [[ $release == "alpine" ]]; then
|
update_ru_geofiles
|
||||||
rc-service x-ui stop
|
|
||||||
else
|
|
||||||
systemctl stop x-ui
|
|
||||||
fi
|
|
||||||
rm -f geoip_RU.dat geosite_RU.dat
|
|
||||||
wget -O geoip_RU.dat -N https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat
|
|
||||||
wget -O geosite_RU.dat -N https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat
|
|
||||||
echo -e "${green}runetfreedom datasets have been updated successfully!${plain}"
|
echo -e "${green}runetfreedom datasets have been updated successfully!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
|
4)
|
||||||
|
update_all_geofiles
|
||||||
|
echo -e "${green}All geo files have been updated successfully!${plain}"
|
||||||
|
restart
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
echo -e "${red}Invalid option. Please select a valid number.${plain}\n"
|
||||||
update_geo
|
update_geo
|
||||||
|
|
@ -1869,7 +1875,7 @@ SSH_port_forwarding() {
|
||||||
}
|
}
|
||||||
|
|
||||||
show_usage() {
|
show_usage() {
|
||||||
echo -e "┌───────────────────────────────────────────────────────┐
|
echo -e "┌────────────────────────────────────────────────────────────────┐
|
||||||
│ ${blue}x-ui control menu usages (subcommands):${plain} │
|
│ ${blue}x-ui control menu usages (subcommands):${plain} │
|
||||||
│ │
|
│ │
|
||||||
│ ${blue}x-ui${plain} - Admin Management Script │
|
│ ${blue}x-ui${plain} - Admin Management Script │
|
||||||
|
|
@ -1883,10 +1889,11 @@ show_usage() {
|
||||||
│ ${blue}x-ui log${plain} - Check logs │
|
│ ${blue}x-ui log${plain} - Check logs │
|
||||||
│ ${blue}x-ui banlog${plain} - Check Fail2ban ban logs │
|
│ ${blue}x-ui banlog${plain} - Check Fail2ban ban logs │
|
||||||
│ ${blue}x-ui update${plain} - Update │
|
│ ${blue}x-ui update${plain} - Update │
|
||||||
│ ${blue}x-ui legacy${plain} - legacy version │
|
│ ${blue}x-ui update-all-geofiles${plain} - Update all geo files │
|
||||||
|
│ ${blue}x-ui legacy${plain} - Legacy version │
|
||||||
│ ${blue}x-ui install${plain} - Install │
|
│ ${blue}x-ui install${plain} - Install │
|
||||||
│ ${blue}x-ui uninstall${plain} - Uninstall │
|
│ ${blue}x-ui uninstall${plain} - Uninstall │
|
||||||
└───────────────────────────────────────────────────────┘"
|
└────────────────────────────────────────────────────────────────┘"
|
||||||
}
|
}
|
||||||
|
|
||||||
show_menu() {
|
show_menu() {
|
||||||
|
|
@ -2056,6 +2063,9 @@ if [[ $# > 0 ]]; then
|
||||||
"uninstall")
|
"uninstall")
|
||||||
check_install 0 && uninstall 0
|
check_install 0 && uninstall 0
|
||||||
;;
|
;;
|
||||||
|
"update-all-geofiles")
|
||||||
|
check_install 0 && update_all_geofiles 0 && restart 0
|
||||||
|
;;
|
||||||
*) show_usage ;;
|
*) show_usage ;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue