Skip to content

Instantly share code, notes, and snippets.

@furlongm
Last active July 25, 2017 21:14
Show Gist options
  • Save furlongm/da218f67fdb5caa5ff2391a869b9ae5f to your computer and use it in GitHub Desktop.
Save furlongm/da218f67fdb5caa5ff2391a869b9ae5f to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -f /etc/redhat-release ] ; then
pssh=pssh
else
pssh=parallel-ssh
fi
if [ ! -d ~/nodes ] ; then
mkdir ~/nodes
fi
if [ "$1" != "" ] ; then
nodes=$1
shift
${pssh} -h ~/nodes/${nodes} -i -t 0 -O "ForwardX11=No" "$@"
else
node_defs="["
for i in `ls ~/nodes` ; do
node_defs="${node_defs}${i}|"
done
echo "${0} ${node_defs%?}]"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment