From f0e32c5b6bd0543aacd7990245c501dc2f1a2689 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Wed, 25 Oct 2023 20:58:14 +0800 Subject: [PATCH] update script --- packaging/tools/install.sh | 10 ++++++---- packaging/tools/makepkg.sh | 2 +- packaging/tools/remove.sh | 13 ++++++------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index d044804db4..6476d542b6 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -379,8 +379,8 @@ function add_newHostname_to_hosts() { } function set_hostname() { - echo -e -n "${GREEN}Host name or IP (assigned to this machine) which can be accessed by your tools or apps: (must not be 'localhost') :${NC}" - read -e -p "" -i "$(hostname)" newHostname + echo -e -n "${GREEN}Host name or IP (assigned to this machine) which can be accessed by your tools or apps (must not be 'localhost')${NC}" + read -e -p " : " -i "$(hostname)" newHostname while true; do if [ -z "$newHostname" ]; then newHostname=$(hostname) @@ -388,8 +388,8 @@ function set_hostname() { elif [ "$newHostname" != "localhost" ]; then break else - echo -e -n "${GREEN}Host name or IP (assigned to this machine) which can be accessed by your tools or apps: (must not be 'localhost') :${NC}" - read -e -p "" -i "$(hostname)" newHostname + echo -e -n "${GREEN}Host name or IP (assigned to this machine) which can be accessed by your tools or apps (must not be 'localhost')${NC}" + read -e -p " : " -i "$(hostname)" newHostname fi done @@ -525,12 +525,14 @@ function install_config() { if [ -f ${script_dir}/cfg/${configFile2} ]; then ${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2} ${csudo} echo "monitorFQDN ${serverFqdn}" >> ${script_dir}/cfg/${configFile2} + ${csudo} echo "audit 1" >> ${script_dir}/cfg/${configFile2} ${csudo}cp ${script_dir}/cfg/${configFile2} ${cfg_install_dir} fi ${csudo}chmod 644 ${cfg_install_dir}/* else ${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2} ${csudo} echo "monitorFQDN ${serverFqdn}" >> ${script_dir}/cfg/${configFile2} + ${csudo} echo "audit 1" >> ${script_dir}/cfg/${configFile2} ${csudo}cp -f ${script_dir}/cfg/${configFile2} ${cfg_install_dir}/${configFile2}.new fi diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 1be8e23e56..d3d72eed24 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -42,7 +42,7 @@ release_dir="${top_dir}/release" #package_name='linux' if [ "$verMode" == "cluster" ]; then - install_dir="${release_dir}/${productName2}-enterprise-server-${version}" + install_dir="${release_dir}/${productName2}-enterprise-${version}" elif [ "$verMode" == "cloud" ]; then install_dir="${release_dir}/${productName2}-cloud-server-${version}" else diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index b815472cad..482b67ccfe 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -283,12 +283,16 @@ function remove_data_and_config() { } function uninstall_taosx() { - if [ -f /usr/local/taosx/uninstall.sh ]; then - cd /usr/local/taosx + if [ -f ${installDir}/uninstall.sh ]; then + cd ${installDir} bash uninstall.sh fi } +if [ "$verMode" == "cluster" ]; then + uninstall_taosx +fi + # Stop service and disable booting start. clean_service # Remove binary file and links @@ -399,11 +403,6 @@ if [ X$answer == X"y" ] || [ X$answer == X"Y" ]; then remove_data_and_config fi - -if [ "$verMode" == "cluster" ]; then - uninstall_taosx -fi - echo echo "${productName2} is removed successfully!" echo \ No newline at end of file