update rmtaos for client
This commit is contained in:
parent
641fccaa93
commit
83e120ba48
|
@ -229,6 +229,9 @@ function install_bin() {
|
|||
if [ -d ${script_dir}/${xname}/bin ]; then
|
||||
${csudo}cp -r ${script_dir}/${xname}/bin/* ${install_main_dir}/bin
|
||||
fi
|
||||
if [ -e ${script_dir}/${xname}/uninstall.sh ]; then
|
||||
${csudo}cp -r ${script_dir}/${xname}/uninstall.sh ${install_main_dir}/uninstall_${xname}.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f ${script_dir}/bin/quick_deploy.sh ]; then
|
||||
|
@ -250,6 +253,8 @@ function install_bin() {
|
|||
for service in "${services[@]}"; do
|
||||
[ -x ${install_main_dir}/bin/${service} ] && ${csudo}ln -sf ${install_main_dir}/bin/${service} ${bin_link_dir}/${service} || :
|
||||
done
|
||||
|
||||
[ ${install_main_dir}/uninstall_${xname}.sh ] && ${csudo}ln -sf ${install_main_dir}/uninstall_${xname}.sh ${bin_link_dir}/uninstall_${xname}.sh || :
|
||||
}
|
||||
|
||||
function install_lib() {
|
||||
|
|
|
@ -56,7 +56,11 @@ local_bin_link_dir="/usr/local/bin"
|
|||
service_config_dir="/etc/systemd/system"
|
||||
config_dir="/etc/${PREFIX}"
|
||||
|
||||
services=(${PREFIX}"d" ${PREFIX}"adapter" ${PREFIX}"x" ${PREFIX}"-explorer" ${PREFIX}"keeper")
|
||||
if [ "${verMode}" == "cluster" ]; then
|
||||
services=(${PREFIX}"d" ${PREFIX}"adapter" ${PREFIX}"keeper")
|
||||
else
|
||||
services=(${PREFIX}"d" ${PREFIX}"adapter" ${PREFIX}"keeper" ${PREFIX}"-explorer")
|
||||
fi
|
||||
tools=(${PREFIX} ${PREFIX}"Benchmark" ${PREFIX}"dump" ${PREFIX}"demo" udfd set_core.sh TDinsight.sh $uninstallScript start-all.sh stop-all.sh)
|
||||
|
||||
csudo=""
|
||||
|
@ -222,6 +226,32 @@ function remove_data_and_config() {
|
|||
[ -d "${log_dir}" ] && ${csudo}rm -rf ${log_dir}
|
||||
}
|
||||
|
||||
function remove_taosx() {
|
||||
if [ -e /usr/local/taos/taosx/uninstall.sh ]; then
|
||||
bash /usr/local/taos/taosx/uninstall.sh
|
||||
fi
|
||||
}
|
||||
|
||||
echo
|
||||
echo "Do you want to remove all the data, log and configuration files? [y/n]"
|
||||
read answer
|
||||
if [ X$answer == X"y" ] || [ X$answer == X"Y" ]; then
|
||||
confirmMsg="I confirm that I would like to delete all data, log and configuration files"
|
||||
echo "Please enter '${confirmMsg}' to continue"
|
||||
read answer
|
||||
if [ X"$answer" == X"${confirmMsg}" ]; then
|
||||
remove_data_and_config
|
||||
if [ -e /usr/bin/uninstall_${PREFIX}x.sh ]; then
|
||||
bash /usr/bin/uninstall_${PREFIX}x.sh --clean-all true
|
||||
fi
|
||||
else
|
||||
echo "answer doesn't match, skip this step"
|
||||
if [ -e /usr/bin/uninstall_${PREFIX}x.sh ]; then
|
||||
bash /usr/bin/uninstall_${PREFIX}x.sh --clean-all false
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
remove_bin
|
||||
clean_header
|
||||
# Remove lib file
|
||||
|
@ -254,20 +284,6 @@ if [ "$osType" = "Darwin" ]; then
|
|||
${csudo}rm -rf /Applications/TDengine.app
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Do you want to remove all the data, log and configuration files? [y/n]"
|
||||
read answer
|
||||
if [ X$answer == X"y" ] || [ X$answer == X"Y" ]; then
|
||||
confirmMsg="I confirm that I would like to delete all data, log and configuration files"
|
||||
echo "Please enter '${confirmMsg}' to continue"
|
||||
read answer
|
||||
if [ X"$answer" == X"${confirmMsg}" ]; then
|
||||
remove_data_and_config
|
||||
else
|
||||
echo "answer doesn't match, skip this step"
|
||||
fi
|
||||
fi
|
||||
|
||||
command -v systemctl >/dev/null 2>&1 && ${csudo}systemctl daemon-reload >/dev/null 2>&1 || true
|
||||
echo
|
||||
echo "${productName} is removed successfully!"
|
||||
|
|
|
@ -31,6 +31,8 @@ bin_link_dir="/usr/bin"
|
|||
lib_link_dir="/usr/lib"
|
||||
lib64_link_dir="/usr/lib64"
|
||||
inc_link_dir="/usr/include"
|
||||
log_dir="/var/log/${clientName2}"
|
||||
cfg_dir="/etc/${clientName2}"
|
||||
|
||||
csudo=""
|
||||
if command -v sudo > /dev/null; then
|
||||
|
@ -92,6 +94,24 @@ function clean_log() {
|
|||
${csudo}rm -rf ${log_link_dir} || :
|
||||
}
|
||||
|
||||
function clean_config_and_log_dir() {
|
||||
# Remove link
|
||||
echo "Do you want to remove all the log and configuration files? [y/n]"
|
||||
read answer
|
||||
if [ X$answer == X"y" ] || [ X$answer == X"Y" ]; then
|
||||
confirmMsg="I confirm that I would like to delete all log and configuration files"
|
||||
echo "Please enter '${confirmMsg}' to continue"
|
||||
read answer
|
||||
if [ X"$answer" == X"${confirmMsg}" ]; then
|
||||
# Remove dir
|
||||
rm -rf ${cfg_dir} || :
|
||||
rm -rf ${log_dir} || :
|
||||
else
|
||||
echo "answer doesn't match, skip this step"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop client.
|
||||
kill_client
|
||||
# Remove binary file and links
|
||||
|
@ -104,6 +124,8 @@ clean_lib
|
|||
clean_log
|
||||
# Remove link configuration file
|
||||
clean_config
|
||||
# Remove dir
|
||||
clean_config_and_log_dir
|
||||
|
||||
${csudo}rm -rf ${install_main_dir}
|
||||
|
||||
|
|
Loading…
Reference in New Issue