diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index a9c3a085db9184ea59f951eaa382119778cbe65b..e116d72d2649940f9d272b8d3d01e34576a4049d 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -54,6 +54,7 @@ if command -v sudo > /dev/null; then fi update_flag=0 +prompt_force=0 initd_mod=0 service_mod=2 @@ -780,7 +781,18 @@ function is_version_compatible() { min_compatible_version=$(${script_dir}/bin/taosd -V | head -1 | cut -d ' ' -f 5) fi + # [TD-5628] prompt to execute taosd --force-keep-file if upgrade from lower version within 2.0.16.0 + exist_version=$(/usr/local/taos/bin/taosd -V | head -1 | cut -d ' ' -f 3) + vercomp $exist_version "2.0.16.0" + case $? in + 2) + prompt_force=1 + ;; + esac + vercomp $curr_version $min_compatible_version + echo "" # avoid $? value not update + case $? in 0) return 0;; 1) return 0;; @@ -789,6 +801,12 @@ function is_version_compatible() { } function update_TDengine() { + # Check if version compatible + if ! is_version_compatible; then + echo -e "${RED}Version incompatible${NC}" + return 1 + fi + # Start to update if [ ! -e taos.tar.gz ]; then echo "File taos.tar.gz does not exist" @@ -797,12 +815,6 @@ function update_TDengine() { tar -zxf taos.tar.gz install_jemalloc - # Check if version compatible - if ! is_version_compatible; then - echo -e "${RED}Version incompatible${NC}" - return 1 - fi - echo -e "${GREEN}Start to update TDengine...${NC}" # Stop the service if running if pidof taosd &> /dev/null; then @@ -875,6 +887,10 @@ function update_TDengine() { echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos -h $serverFqdn${NC} in shell${NC}" fi + if ((${prompt_force}==1)); then + echo "" + echo -e "${RED}Please run 'taosd --force-keep-file' at first time for the exist TDengine $exist_version!${NC}" + fi echo echo -e "\033[44;32;1mTDengine is updated successfully!${NC}" else