Commit b93fa0a3 authored by julian.gethmann's avatar julian.gethmann

clean up pelegant_setup.sh code

parent de1f88fa
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment