Created
December 20, 2019 00:03
-
-
Save suparious/a12d7d80e24fb81c33ea4712e902af15 to your computer and use it in GitHub Desktop.
Remote SSH Admin
This file contains hidden or 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 | |
#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