Merge pull request #23410 from taosdata/packaging/TD-26791

update script
This commit is contained in:
Alex Duan 2023-10-25 21:04:37 +08:00 committed by GitHub
commit 453e077ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View File

@ -379,8 +379,8 @@ function add_newHostname_to_hosts() {
} }
function set_hostname() { 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}" 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 read -e -p " : " -i "$(hostname)" newHostname
while true; do while true; do
if [ -z "$newHostname" ]; then if [ -z "$newHostname" ]; then
newHostname=$(hostname) newHostname=$(hostname)
@ -388,8 +388,8 @@ function set_hostname() {
elif [ "$newHostname" != "localhost" ]; then elif [ "$newHostname" != "localhost" ]; then
break break
else 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}" 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 read -e -p " : " -i "$(hostname)" newHostname
fi fi
done done
@ -525,12 +525,14 @@ function install_config() {
if [ -f ${script_dir}/cfg/${configFile2} ]; then if [ -f ${script_dir}/cfg/${configFile2} ]; then
${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2} ${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2}
${csudo} echo "monitorFQDN ${serverFqdn}" >> ${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} ${csudo}cp ${script_dir}/cfg/${configFile2} ${cfg_install_dir}
fi fi
${csudo}chmod 644 ${cfg_install_dir}/* ${csudo}chmod 644 ${cfg_install_dir}/*
else else
${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2} ${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2}
${csudo} echo "monitorFQDN ${serverFqdn}" >> ${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 ${csudo}cp -f ${script_dir}/cfg/${configFile2} ${cfg_install_dir}/${configFile2}.new
fi fi

View File

@ -42,7 +42,7 @@ release_dir="${top_dir}/release"
#package_name='linux' #package_name='linux'
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
install_dir="${release_dir}/${productName2}-enterprise-server-${version}" install_dir="${release_dir}/${productName2}-enterprise-${version}"
elif [ "$verMode" == "cloud" ]; then elif [ "$verMode" == "cloud" ]; then
install_dir="${release_dir}/${productName2}-cloud-server-${version}" install_dir="${release_dir}/${productName2}-cloud-server-${version}"
else else

View File

@ -283,12 +283,16 @@ function remove_data_and_config() {
} }
function uninstall_taosx() { function uninstall_taosx() {
if [ -f /usr/local/taosx/uninstall.sh ]; then if [ -f ${installDir}/uninstall.sh ]; then
cd /usr/local/taosx cd ${installDir}
bash uninstall.sh bash uninstall.sh
fi fi
} }
if [ "$verMode" == "cluster" ]; then
uninstall_taosx
fi
# Stop service and disable booting start. # Stop service and disable booting start.
clean_service clean_service
# Remove binary file and links # Remove binary file and links
@ -399,11 +403,6 @@ if [ X$answer == X"y" ] || [ X$answer == X"Y" ]; then
remove_data_and_config remove_data_and_config
fi fi
if [ "$verMode" == "cluster" ]; then
uninstall_taosx
fi
echo echo
echo "${productName2} is removed successfully!" echo "${productName2} is removed successfully!"
echo echo