diff --git a/README.md b/README.md index 35e29b0b..e60d5a95 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) ``` -## Install Old Version (we don't recommend) +## Install legacy Version (we don't recommend) To install your desired version, use following installation command. e.g., ver `v1.7.9`: diff --git a/install.sh b/install.sh index 7900d98c..c6c52000 100644 --- a/install.sh +++ b/install.sh @@ -274,7 +274,7 @@ install_x-ui() { echo -e "x-ui log - Check logs" echo -e "x-ui banlog - Check Fail2ban ban logs" echo -e "x-ui update - Update" - echo -e "x-ui custom - custom version" + echo -e "x-ui legacy - legacy version" echo -e "x-ui install - Install" echo -e "x-ui uninstall - Uninstall" echo -e "----------------------------------------------" diff --git a/main.go b/main.go index a07bd641..84ffca6e 100644 --- a/main.go +++ b/main.go @@ -461,6 +461,9 @@ func main() { if getListen { GetListenIP(getListen) } + if getCert { + GetCertificate(getCert) + } if (tgbottoken != "") || (tgbotchatid != "") || (tgbotRuntime != "") { updateTgbotSetting(tgbottoken, tgbotchatid, tgbotRuntime) } @@ -481,10 +484,6 @@ func main() { } else { updateCert(webCertFile, webKeyFile) } - if getCert { - GetCertificate(getCert) - } - default: fmt.Println("Invalid subcommands") fmt.Println() diff --git a/x-ui.sh b/x-ui.sh index 46a735a8..77408607 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -192,7 +192,7 @@ update_menu() { fi } -custom_version() { +legacy_version() { echo "Enter the panel version (like 2.4.0):" read tag_version @@ -200,17 +200,8 @@ custom_version() { echo "Panel version cannot be empty. Exiting." exit 1 fi - - min_version="2.3.5" - if [[ "$(printf '%s\n' "$tag_version" "$min_version" | sort -V | head -n1)" == "$tag_version" && "$tag_version" != "$min_version" ]]; then - echo "Please use a newer version (at least 2.3.5). Exiting." - exit 1 - fi - - download_link="https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh" - # Use the entered panel version in the download link - install_command="bash <(curl -Ls $download_link) v$tag_version" + install_command="bash <(curl -Ls "https://raw.githubusercontent.com/mhsanaei/3x-ui/v$tag_version/install.sh") v$tag_version" echo "Downloading and installing panel version $tag_version..." eval $install_command @@ -1555,7 +1546,7 @@ show_menu() { ${green}1.${plain} Install ${green}2.${plain} Update ${green}3.${plain} Update Menu - ${green}4.${plain} Old Version + ${green}4.${plain} Legacy Version ${green}5.${plain} Uninstall ———————————————— ${green}6.${plain} Reset Username & Password & Secret Token @@ -1600,7 +1591,7 @@ show_menu() { check_install && update_menu ;; 4) - check_install && custom_version + check_install && legacy_version ;; 5) check_install && uninstall @@ -1703,8 +1694,8 @@ if [[ $# > 0 ]]; then "update") check_install 0 && update 0 ;; - "custom") - check_install 0 && custom_version 0 + "legacy") + check_install 0 && legacy_version 0 ;; "install") check_uninstall 0 && install 0