Skip to content

Instantly share code, notes, and snippets.

@hoto
Created January 5, 2017 18:11
Show Gist options
  • Save hoto/4c0aed8399ed471d53b1c7bbbcf775ee to your computer and use it in GitHub Desktop.
Save hoto/4c0aed8399ed471d53b1c7bbbcf775ee to your computer and use it in GitHub Desktop.
LIST=`fleetctl list-machines | grep worker | awk '{print $2}'`
for item in $LIST; do echo $item; done
for item in $LIST; do ssh -A core@$item; done
@hoto
Copy link
Author

hoto commented Jan 27, 2017

LIST=`fleetctl list-machines | awk '{print $2}'`
for item in $LIST; do echo $item; done
for item in $LIST; do ssh -A core@$item echo "xxx" >> ~/.ssh/authorized_keys; done

LIST=`fleetctl list-machines | awk '{print $2}'`
for item in $LIST; do echo $item; done
for item in $LIST; do echo item=$item; ssh -A core@$item cat ~/.ssh/authorized_keys | grep xxx; done

@hoto
Copy link
Author

hoto commented Mar 21, 2017

Update:

LIST=$(fleetctl list-machines | grep worker |awk '{print $2}')

for item in $LIST; \
  do echo "Found Machine IP=$item"; \
done

for item in $LIST; do \
  echo "Machine IP=$item" && \
  ssh -A -o StrictHostKeyChecking=no core@$item \
    hostname \
; done

for item in $LIST; do \
  echo "Machine IP=$item" && \
  ssh -A -o StrictHostKeyChecking=no core@$item \
    echo "xxx" >> ~/.ssh/authorized_keys \
; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment