fix(os): fix package client error
This commit is contained in:
parent
bfa5caa2d2
commit
a3c159925d
|
@ -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() {
|
||||||
|
|
||||||
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,42 +270,49 @@ 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
|
||||||
echo -e "${GREEN}Start to install ${productName} client...${NC}"
|
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}"
|
||||||
|
|
||||||
install_main_path
|
install_main_path
|
||||||
install_log
|
install_log
|
||||||
install_header
|
install_header
|
||||||
install_lib
|
install_lib
|
||||||
install_jemalloc
|
install_jemalloc
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
install_connector
|
install_connector
|
||||||
fi
|
fi
|
||||||
install_examples
|
install_examples
|
||||||
install_bin
|
install_bin
|
||||||
install_config
|
install_config
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "\033[44;32;1m${productName} client is installed successfully!${NC}"
|
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============================
|
## ==============================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
|
||||||
|
|
Loading…
Reference in New Issue