Created
December 18, 2023 08:50
-
-
Save sloppycoder/617f26b0a6df1594244469673ff9cfa4 to your computer and use it in GitHub Desktop.
execute command on remote hosts
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 | |
| CMD=$1 | |
| run() ( | |
| HOST=$1 | |
| ssh $HOST "$CMD" | |
| ) | |
| for host in pie4 pie5 pie6 pie7 pie8 pie9 | |
| do | |
| echo ==== $host ==== | |
| run pi@$host | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment