github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/e2e/bin/update (about)

     1  #!/bin/bash
     2  
     3  if [ $# -ne 2 ]; then
     4      echo "./upload.sh <source> <destination>"
     5      exit 1
     6  fi
     7  
     8  set -e
     9  
    10  nodes=$(terraform output -json -state=terraform/terraform.tfstate | jq -r '(.clients,.servers).value[]')
    11  for node in $nodes
    12  do
    13      echo Executing: scp -C -i terraform/keys/*.pem "$1" ubuntu@$node:"$2"
    14      # scp -o StrictHostKeyChecking=accept-new -C -i terraform/keys/*.pem "$1" ubuntu@$node:"$2"
    15      scp -o StrictHostKeyChecking=accept-new -C -i terraform/keys/*.pem "$1" ubuntu@$node:/tmp/uploaded
    16      ssh -i terraform/keys/*.pem ubuntu@$node sudo mv /tmp/uploaded "$2"
    17  done