[TD-1017]
This commit is contained in:
parent
bfceaf20cc
commit
8e410b8a30
|
@ -99,6 +99,44 @@ else
|
||||||
os_type=1
|
os_type=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# ============================= get input parameters =================================================
|
||||||
|
|
||||||
|
# install.sh -v [server | client] -e [yes | no] -i [systemd | service | ...]
|
||||||
|
|
||||||
|
# set parameters by default value
|
||||||
|
interactiveFqdn=yes # [yes | no]
|
||||||
|
verType=server # [server | client]
|
||||||
|
initType=systemd # [systemd | service | ...]
|
||||||
|
|
||||||
|
while getopts "hv:e:i:" arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
e)
|
||||||
|
#echo "interactiveFqdn=$OPTARG"
|
||||||
|
interactiveFqdn=$( echo $OPTARG )
|
||||||
|
;;
|
||||||
|
v)
|
||||||
|
#echo "verType=$OPTARG"
|
||||||
|
verType=$(echo $OPTARG)
|
||||||
|
;;
|
||||||
|
i)
|
||||||
|
#echo "initType=$OPTARG"
|
||||||
|
initType=$(echo $OPTARG)
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
echo "Usage: `basename $0` -v [server | client] -e [yes | no]"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
?) #unknow option
|
||||||
|
echo "unkonw argument"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
|
||||||
|
|
||||||
function kill_taosd() {
|
function kill_taosd() {
|
||||||
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
|
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
|
||||||
if [ -n "$pid" ]; then
|
if [ -n "$pid" ]; then
|
||||||
|
@ -191,6 +229,10 @@ function install_config() {
|
||||||
if ((${update_flag}==1)); then
|
if ((${update_flag}==1)); then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$interactiveFqdn" == "no" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
#FQDN_FORMAT="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
|
#FQDN_FORMAT="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
|
||||||
#FQDN_FORMAT="(:[1-6][0-9][0-9][0-9][0-9]$)"
|
#FQDN_FORMAT="(:[1-6][0-9][0-9][0-9][0-9]$)"
|
||||||
|
@ -653,8 +695,8 @@ function install_TDengine() {
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -673,7 +715,7 @@ function install_TDengine() {
|
||||||
|
|
||||||
|
|
||||||
## ==============================Main program starts from here============================
|
## ==============================Main program starts from here============================
|
||||||
if [ -z $1 ]; then
|
if [ "$verType" == "server" ]; then
|
||||||
# Install server and client
|
# Install server and client
|
||||||
if [ -x ${bin_dir}/taosd ]; then
|
if [ -x ${bin_dir}/taosd ]; then
|
||||||
update_flag=1
|
update_flag=1
|
||||||
|
@ -681,7 +723,8 @@ if [ -z $1 ]; then
|
||||||
else
|
else
|
||||||
install_TDengine
|
install_TDengine
|
||||||
fi
|
fi
|
||||||
else
|
elif [ "$verType" == "client" ]; then
|
||||||
|
interactiveFqdn=no
|
||||||
# Only install client
|
# Only install client
|
||||||
if [ -x ${bin_dir}/taos ]; then
|
if [ -x ${bin_dir}/taos ]; then
|
||||||
update_flag=1
|
update_flag=1
|
||||||
|
@ -689,4 +732,6 @@ else
|
||||||
else
|
else
|
||||||
install_TDengine client
|
install_TDengine client
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "please input correct verType"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue