未验证 提交 46c1fb94 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

Merge pull request #12911 from taosdata/fix/ZhiqiangWang/TD-15533-fix-package-client-error

fix(os): fix package client error
...@@ -17,6 +17,7 @@ serverName="taosd" ...@@ -17,6 +17,7 @@ serverName="taosd"
clientName="taos" clientName="taos"
uninstallScript="rmtaos" uninstallScript="rmtaos"
configFile="taos.cfg" configFile="taos.cfg"
tarName="taos.tar.gz"
osType=Linux osType=Linux
pagMode=full pagMode=full
...@@ -242,6 +243,11 @@ function install_examples() { ...@@ -242,6 +243,11 @@ function install_examples() {
function update_TDengine() { function update_TDengine() {
# Start to update # 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}" echo -e "${GREEN}Start to update ${productName} client...${NC}"
# Stop the client shell if running # Stop the client shell if running
if pidof ${clientName} &> /dev/null; then if pidof ${clientName} &> /dev/null; then
...@@ -264,10 +270,17 @@ function update_TDengine() { ...@@ -264,10 +270,17 @@ function update_TDengine() {
echo echo
echo -e "\033[44;32;1m${productName} client is updated successfully!${NC}" echo -e "\033[44;32;1m${productName} client is updated successfully!${NC}"
rm -rf $(tar -tf ${tarName})
} }
function install_TDengine() { function install_TDengine() {
# Start to install # 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 -e "${GREEN}Start to install ${productName} client...${NC}"
install_main_path install_main_path
...@@ -292,14 +305,14 @@ function install_TDengine() { ...@@ -292,14 +305,14 @@ function install_TDengine() {
## ==============================Main program starts from here============================ ## ==============================Main program starts from here============================
# Install or updata client and client # Install or updata client and client
# if server is already install, don't install client # if server is already install, don't install client
if [ -e ${bin_dir}/${serverName} ]; then if [ -e ${bin_dir}/${serverName} ]; then
echo -e "\033[44;32;1mThere are already installed ${productName} server, so don't need install client!${NC}" echo -e "\033[44;32;1mThere are already installed ${productName} server, so don't need install client!${NC}"
exit 0 exit 0
fi fi
if [ -x ${bin_dir}/${clientName} ]; then if [ -x ${bin_dir}/${clientName} ]; then
update_flag=1 update_flag=1
update_TDengine update_TDengine
else else
install_TDengine install_TDengine
fi fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册