X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fsite%2Fvm%2Fvm.sh;h=8d65df7f4e938af9cdfe241626bd1884b11206f7;hb=f056a7ebac7dae36cee4f9bfd4869e9de76ad6f7;hp=51ad4c9c9130ae1e9d49aed24f240925aa6a93da;hpb=8954e02334a32e07f0b5fa09679a2b5c484b4a9d;p=icn.git diff --git a/deploy/site/vm/vm.sh b/deploy/site/vm/vm.sh old mode 100644 new mode 100755 index 51ad4c9..8d65df7 --- a/deploy/site/vm/vm.sh +++ b/deploy/site/vm/vm.sh @@ -84,7 +84,7 @@ function insert_control_plane_network_identity_into_ssh_config { prefix=$(helm -n ${SITE_NAMESPACE} get values -a cluster-icn | awk '/controlPlanePrefix:/ {print $2}') host=$(ipcalc ${endpoint}/${prefix} | awk '/Network:/ {sub(/\.0.*/,".*"); print $2}') if [[ $(grep -c "Host ${host}" ${HOME}/.ssh/config) != 0 ]]; then - sed -i -e '/Host '"${host}"'/,+1 d' ${HOME}/.ssh/config + sed -i -e '/Host '"${host}"'/,+3 d' ${HOME}/.ssh/config fi cat <>${HOME}/.ssh/config Host ${host} @@ -94,6 +94,8 @@ Host ${host} EOF # Add the identity to authorized keys on this host to enable ssh # logins via its control plane address + authorized_key=$(cat ${SCRIPTDIR}/id_rsa.pub) + sed -i -e '\!'"${authorized_key}"'!d' ${HOME}/.ssh/authorized_keys cat ${SCRIPTDIR}/id_rsa.pub >> ~/.ssh/authorized_keys }