From dd49d0e717ff789dda0ca1d0fe401c2a0038800c Mon Sep 17 00:00:00 2001 From: miao_kaibo Date: Wed, 2 Jun 2021 14:39:47 +0800 Subject: [PATCH] delete info of dailybuild server from known_hosts --- script/tools/common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/tools/common.sh b/script/tools/common.sh index fa361d4..0638651 100644 --- a/script/tools/common.sh +++ b/script/tools/common.sh @@ -112,7 +112,7 @@ function replace_release_server_ip() SSHPORT="" fi setupfile=`find -iname "setup_env.sh"` - for((i=0;i<3;i++)); + for((i=0;i<5;i++)); do ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa ${SSHPORT} root@${RELEASE_SERVER_IP} ip addr | grep inet | awk '{print $2}' | grep -v '127' | awk -F '/' '{print $1}' | sed -n '1p') if [ -n "$ret" ];then @@ -121,6 +121,10 @@ function replace_release_server_ip() sed -i "s/RELEASE_SERVER_PORT=\"${RELEASE_SERVER_PORT}\"/RELEASE_SERVER_PORT=""/g" ${setupfile} fi break + else + if [ $i -eq 0 ];then + sed -i "/${RELEASE_SERVER_IP}/d" ~/.ssh/known_hosts + fi fi done } -- Gitee