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 ...@@ -29,21 +29,21 @@ if [ -f ~/.mpihosts ]; then
/usr/bin/mv ~/.mpihosts ~/.mpihosts.$(date --iso) /usr/bin/mv ~/.mpihosts ~/.mpihosts.$(date --iso)
fi fi
for host in "${!host_cpus[@]}"; do 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 done
printf "Copying files and mounting SSHFS\n" printf "Copying files and mounting SSHFS\n"
for host in "${!host_cpus[@]}"; do 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}" "${host}:~/.ssh/"
scp "${filename}.pub" "${host}:~/.ssh/" scp "${filename}.pub" "${host}:~/.ssh/"
ssh-copy-id -i "${filename}" ${host} ssh-copy-id -i "${filename}" "${host}"
ssh-copy-id -i "${filename}" ${main_host} ssh-copy-id -i "${filename}" "${main_host}"
scp ~/.mpihosts "${host}:.mpihosts" scp ~/.mpihosts "${host}:.mpihosts"
curdir=${PWD} curdir=${PWD}
ssh -i "${filename}" ${host} "ssh-copy-id -i ${filename} ${main_host}" ssh -i "${filename}" "${host}"\
ssh -i "${filename}" ${host} "mkdir ${curdir} && sshfs ${main_host}:${curdir} ${curdir} -o IdentityFile=\"${filename}\"" "mkdir ${curdir} && "\
"sshfs ${main_host}:${curdir} ${curdir} -o IdentityFile=\"${filename}\""
done 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