From a3c159925d5f3576cdc0346cce23a45d94854132 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 24 May 2022 15:12:50 +0800 Subject: [PATCH] fix(os): fix package client error --- packaging/tools/install_client.sh | 67 ++++++++++++++++++------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/packaging/tools/install_client.sh b/packaging/tools/install_client.sh index 4cf95454e0..5f449e5d91 100755 --- a/packaging/tools/install_client.sh +++ b/packaging/tools/install_client.sh @@ -17,6 +17,7 @@ serverName="taosd" clientName="taos" uninstallScript="rmtaos" configFile="taos.cfg" +tarName="taos.tar.gz" osType=Linux pagMode=full @@ -242,6 +243,11 @@ function install_examples() { function update_TDengine() { # Start to update + if [ ! -e ${tarName} ]; then + echo "File ${tarName} does not exist" + exit 1 + fi + tar -zxf ${tarName} echo -e "${GREEN}Start to update ${productName} client...${NC}" # Stop the client shell if running if pidof ${clientName} &> /dev/null; then @@ -264,42 +270,49 @@ function update_TDengine() { echo echo -e "\033[44;32;1m${productName} client is updated successfully!${NC}" + + rm -rf $(tar -tf ${tarName}) } function install_TDengine() { - # Start to install - echo -e "${GREEN}Start to install ${productName} client...${NC}" - - install_main_path - install_log - install_header - install_lib - install_jemalloc - if [ "$verMode" == "cluster" ]; then - install_connector - fi - install_examples - install_bin - install_config + # Start to install + if [ ! -e ${tarName} ]; then + echo "File ${tarName} does not exist" + exit 1 + fi + tar -zxf ${tarName} + echo -e "${GREEN}Start to install ${productName} client...${NC}" - echo - echo -e "\033[44;32;1m${productName} client is installed successfully!${NC}" + install_main_path + install_log + install_header + install_lib + install_jemalloc + if [ "$verMode" == "cluster" ]; then + install_connector + fi + install_examples + install_bin + install_config + + echo + echo -e "\033[44;32;1m${productName} client is installed successfully!${NC}" - rm -rf $(tar -tf ${tarName}) + rm -rf $(tar -tf ${tarName}) } ## ==============================Main program starts from here============================ # Install or updata client and client # if server is already install, don't install client - if [ -e ${bin_dir}/${serverName} ]; then - echo -e "\033[44;32;1mThere are already installed ${productName} server, so don't need install client!${NC}" - exit 0 - fi +if [ -e ${bin_dir}/${serverName} ]; then + echo -e "\033[44;32;1mThere are already installed ${productName} server, so don't need install client!${NC}" + exit 0 +fi - if [ -x ${bin_dir}/${clientName} ]; then - update_flag=1 - update_TDengine - else - install_TDengine - fi +if [ -x ${bin_dir}/${clientName} ]; then + update_flag=1 + update_TDengine +else + install_TDengine +fi -- GitLab