浏览代码

Update INSTALL.sh

Stefan Pejcic 1 年之前
父节点
当前提交
75aebc8228
共有 1 个文件被更改,包括 15 次插入7 次删除
  1. 15 7
      INSTALL.sh

+ 15 - 7
INSTALL.sh

@@ -34,6 +34,7 @@ RED='\033[0;31m'
 RESET='\033[0m'
 RESET='\033[0m'
 
 
 # Defaults
 # Defaults
+CUSTOM_VERSION=false
 INSTALL_TIMEOUT=1800 # 30 min
 INSTALL_TIMEOUT=1800 # 30 min
 DEBUG=false
 DEBUG=false
 SKIP_APT_UPDATE=false
 SKIP_APT_UPDATE=false
@@ -174,14 +175,16 @@ if [ -z "$current_ip" ]; then
 fi
 fi
 
 
 
 
-# Fetch the latest version
-version=$(curl -s https://update.openpanel.co/)
-if [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
-    version=$version
-else
-    version="0.1.7"
-fi
 
 
+if [ "$CUSTOM_VERSION" = false ]; then
+    # Fetch the latest version
+    version=$(curl -s https://update.openpanel.co/)
+    if [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
+        version=$version
+    else
+        version="0.1.7"
+    fi
+fi
 
 
 # print fullwidth line
 # print fullwidth line
 print_space_and_line() {
 print_space_and_line() {
@@ -364,6 +367,11 @@ parse_args() {
                 # Extract path after "--post_install="
                 # Extract path after "--post_install="
                 post_install_path="${1#*=}"
                 post_install_path="${1#*=}"
                 ;;
                 ;;
+            --version=*)
+                # Extract path after "--version="
+                CUSTOM_VERSION=true
+                version="${1#*=}"
+                ;;
             *)
             *)
                 echo "Unknown option: $arg"
                 echo "Unknown option: $arg"
                 exit 1
                 exit 1