github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/dm/tests/tiup/docker/control/init.sh (about) 1 #!/bin/sh 2 3 if [ ! -f ~/.ssh/known_hosts ]; then 4 mkdir -m 700 ~/.ssh 5 echo $SSH_PRIVATE_KEY | perl -p -e 's/↩/\n/g' >~/.ssh/id_rsa 6 chmod 600 ~/.ssh/id_rsa 7 echo $SSH_PUBLIC_KEY >~/.ssh/id_rsa.pub 8 echo >~/.ssh/known_hosts 9 for f in $(seq 1 5); do 10 ssh-keyscan -t rsa n$f >>~/.ssh/known_hosts 11 done 12 fi 13 14 # hack for keep this container running 15 tail -f /dev/null