diff --git a/script/install.sh b/script/install.sh index 16be44591d..dcde12ad88 100755 --- a/script/install.sh +++ b/script/install.sh @@ -24,9 +24,15 @@ source ${workDir}/env/dolphinscheduler_env.sh echo "1.create directory" +# If install Path equal to "/" or related path is "/" or is empty, will cause directory "/bin" be overwrite or file adding, +# so we should check its value. Here use command `realpath` to get the related path, and it will skip if your shell env +# without command `realpath`. if [ ! -d $installPath ];then sudo mkdir -p $installPath sudo chown -R $deployUser:$deployUser $installPath +elif [[ -z "${installPath// }" || "${installPath// }" == "/" || ( $(command -v realpath) && $(realpath -s "${installPath}") == "/" ) ]]; then + echo "Parameter installPath can not be empty, use in root path or related path of root path, currently use ${installPath}" + exit 1 fi echo "2.scp resources" diff --git a/script/scp-hosts.sh b/script/scp-hosts.sh index 5ac51de8ed..25b688170a 100755 --- a/script/scp-hosts.sh +++ b/script/scp-hosts.sh @@ -40,8 +40,6 @@ do fi echo "scp dirs to $host/$installPath starting" - ssh -p $sshPort $host "cd $installPath/; rm -rf bin/ master-server/ worker-server/ alert-server/ api-server/ ui/ tools/" - for i in ${!workerNames[@]}; do if [[ ${workerNames[$i]} == $host ]]; then workerIndex=$i