diff --git a/roles/elegant/files/pelegant_setup.sh b/roles/elegant/files/pelegant_setup.sh index 429cda9bfcb5ff3a60fab797526b70ccef0e4751..48a9b938bd0a289c793c769bfb7b947d3760bca0 100755 --- a/roles/elegant/files/pelegant_setup.sh +++ b/roles/elegant/files/pelegant_setup.sh @@ -29,21 +29,21 @@ if [ -f ~/.mpihosts ]; then /usr/bin/mv ~/.mpihosts ~/.mpihosts.$(date --iso) fi for host in "${!host_cpus[@]}"; do - /usr/bin/echo "${host}:${host_cpus[$host]}" user=${USER} >> ~/.mpihosts + printf "%s:%s user=%s\n", "${host}" "${host_cpus[$host]}" "${USER}" >> ~/.mpihosts done printf "Copying files and mounting SSHFS\n" for host in "${!host_cpus[@]}"; do - cpu="${host_cpus[$host]}" - printf "SSH copy from %s to %s (%s)", ${main_host}, ${host}, ${filename} + printf "SSH copy from %s to %s (%s)", "${main_host}" "${host}" "${filename}" scp "${filename}" "${host}:~/.ssh/" scp "${filename}.pub" "${host}:~/.ssh/" - ssh-copy-id -i "${filename}" ${host} - ssh-copy-id -i "${filename}" ${main_host} + ssh-copy-id -i "${filename}" "${host}" + ssh-copy-id -i "${filename}" "${main_host}" scp ~/.mpihosts "${host}:.mpihosts" curdir=${PWD} - ssh -i "${filename}" ${host} "ssh-copy-id -i ${filename} ${main_host}" - ssh -i "${filename}" ${host} "mkdir ${curdir} && sshfs ${main_host}:${curdir} ${curdir} -o IdentityFile=\"${filename}\"" + ssh -i "${filename}" "${host}"\ + "mkdir ${curdir} && "\ + "sshfs ${main_host}:${curdir} ${curdir} -o IdentityFile=\"${filename}\"" done