Skip to content

Commit

Permalink
bash - remove version limit
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei committed Oct 31, 2024
1 parent c158e6e commit eb58314
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "----------------------------------------------"
Expand Down
21 changes: 6 additions & 15 deletions x-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,16 @@ update_menu() {
fi
}

custom_version() {
legacy_version() {
echo "Enter the panel version (like 2.4.0):"
read tag_version

if [ -z "$tag_version" ]; then
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
Expand Down Expand Up @@ -1476,7 +1467,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
Expand Down Expand Up @@ -1520,7 +1511,7 @@ show_menu() {
check_install && update_menu
;;
4)
check_install && custom_version
check_install && legacy_version
;;
5)
check_install && uninstall
Expand Down Expand Up @@ -1620,8 +1611,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
Expand Down

0 comments on commit eb58314

Please sign in to comment.