Last active
January 5, 2022 00:00
-
-
Save jasenmichael/0619e4eb1d29cd88b58c6937fcb27b0b to your computer and use it in GitHub Desktop.
ssh-list.sh
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 | |
usage() { | |
cat <<EOM | |
Usage: | |
$(basename $0) '[remotes]' '[command]' | |
example: | |
$(basename $0) 'ELIT ASHC' 'cd /var/www/html && pwd' | |
EOM | |
exit 0 | |
} | |
[ $# -ne 2 ] && { usage; } | |
clients=($1) | |
for i in "${clients[@]}" | |
do | |
ssh $i $2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment