open-nomad/e2e/bin/run
Tim Gross 4078e6ea0e
scripts: fix interpreter for bash (#12549)
Many of our scripts have a non-portable interpreter line for bash and
use bash-specific variables like `BASH_SOURCE`. Update the interpreter
line to be portable between various Linuxes and macOS without
complaint from posix shell users.
2022-04-12 10:08:21 -04:00

16 lines
394 B
Bash
Executable file

#!/usr/bin/env bash
set -e
if [ "$1" == "" ]; then
echo "./run.sh commands..."
exit 1
fi
nodes=$(terraform output -json -state=terraform/terraform.tfstate | jq -r '(.linux_clients,.servers).value[]')
for node in $nodes
do
echo Executing: ssh -i terraform/keys/*.pem ubuntu@"$node" "$@"
ssh -o StrictHostKeyChecking=accept-new -i terraform/keys/*.pem ubuntu@"$node" "$@"
done