Last active
July 25, 2017 21:14
-
-
Save furlongm/da218f67fdb5caa5ff2391a869b9ae5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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