echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
if["$verMode"=="cluster"];then
# Check if openresty is installed
openresty_work=false
# Check if nginx is installed successfully
if type curl &> /dev/null;then
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null;then
echo-e"\033[44;32;1mNginx for DB_FULL_NAME is updated successfully!${NC}"
openresty_work=true
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
echo-e"\033[44;31;5mNginx for DB_FULL_NAME does not work! Please try again!\033[0m"
fi
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
echo
echo-e"\033[44;32;1mDB_FULL_NAME is updated successfully!${NC}"
fi
echo
echo-e"\033[44;32;1mDB_FULL_NAME is updated successfully!${NC}"
echo-e"\033[44;32;1mDB_FULL_NAME client is updated successfully!${NC}"
if["$verMode"=="cluster"];then
if[${openresty_work}='true'];then
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
echo
echo-e"\033[44;32;1mDB_FULL_NAME is updated successfully!${NC}"
rm-rf$(tar-tf DB_CLIENT_NAME.tar.gz)
}
...
...
@@ -552,11 +549,7 @@ function install_DB_FULL_NAME() {
echo-e"${GREEN}Start to install DB_FULL_NAME...${NC}"
install_main_path
if[-z$1];then
install_data
fi
install_data
install_log
install_header
install_lib
...
...
@@ -565,78 +558,61 @@ function install_DB_FULL_NAME() {
fi
install_examples
if[-z$1];then# install service and client
# For installing new
install_bin
install_service
if["$verMode"=="cluster"];then
openresty_work=false
# Check if nginx is installed successfully
if type curl &> /dev/null;then
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null;then
echo-e"\033[44;32;1mNginx for DB_FULL_NAME is installed successfully!${NC}"
openresty_work=true
else
echo-e"\033[44;31;5mNginx for DB_FULL_NAME does not work! Please try again!\033[0m"
fi
# For installing new
install_bin
install_service
if["$verMode"=="cluster"];then
openresty_work=false
# Check if nginx is installed successfully
if type curl &> /dev/null;then
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null;then
echo-e"\033[44;32;1mNginx for DB_FULL_NAME is installed successfully!${NC}"
openresty_work=true
else
echo-e"\033[44;31;5mNginx for DB_FULL_NAME does not work! Please try again!\033[0m"
fi
fi
install_config
fi
# Ask if to start the service
echo
echo-e"\033[44;32;1mDB_FULL_NAME is installed successfully!${NC}"
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
echo
echo-e"\033[44;32;1mDB_FULL_NAME is installed successfully!${NC}"
else# Only install client
install_bin
install_config
install_config
echo
echo-e"\033[44;32;1mDB_FULL_NAME client is installed successfully!${NC}"
# Ask if to start the service
echo
echo-e"\033[44;32;1mDB_FULL_NAME is installed successfully!${NC}"
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
else
echo-e"${GREEN_DARK}To access DB_FULL_NAME ${NC}: use ${GREEN_UNDERLINE}DB_CLIENT_NAME${NC} in shell${NC}"
fi
echo
echo-e"\033[44;32;1mDB_FULL_NAME is installed successfully!${NC}"
rm-rf$(tar-tf DB_CLIENT_NAME.tar.gz)
}
## ==============================Main program starts from here============================