Skip to content

Instantly share code, notes, and snippets.

@suparious
Created December 20, 2019 00:03
Show Gist options
  • Save suparious/a12d7d80e24fb81c33ea4712e902af15 to your computer and use it in GitHub Desktop.
Save suparious/a12d7d80e24fb81c33ea4712e902af15 to your computer and use it in GitHub Desktop.
Remote SSH Admin
#!/bin/bash
#FRIENDS=(blaze kolvicy godberry poseidon hades)
# Declare a list of cluster members, using the project repo name as our hook
FRIENDS=$(docker node ls | grep -vE '\*|HOSTNAME' | awk '{print $2}')
function friend {
for friend in ${FRIENDS[@]}; do
echo "Chatting with: $friend, about $1"
ssh -tq $friend "$1"
done
echo "Chatting with: $(hostname), about $1"
$1
}
#alias src='cd /media/source'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment