From 48a465ef163694cce9a5590dc3848b30a891bf6b Mon Sep 17 00:00:00 2001 From: wangchong1995924 <15229716099@163.com> Date: Mon, 18 Apr 2022 17:05:09 +0800 Subject: [PATCH] improve ssh stability --- script/tools/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/tools/common.sh b/script/tools/common.sh index 0638651..760d95e 100644 --- a/script/tools/common.sh +++ b/script/tools/common.sh @@ -114,7 +114,7 @@ function replace_release_server_ip() setupfile=`find -iname "setup_env.sh"` 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') + ret=$(ssh -i ~/.ssh/super_publish_rsa ${SSHPORT} -o StrictHostKeyChecking=no -o ServerAliveInterval=60 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 sed -i "s/RELEASE_SERVER_IP=\"${RELEASE_SERVER_IP}\"/RELEASE_SERVER_IP=\"$ret\"/g" ${setupfile} if [ "$ret" != "${RELEASE_SERVER_IP}" ];then -- Gitee