bin/MACC02VK5ECHTD7/jws-ssh
#!/bin/sh
# input: us-east-1a 172.29.71.236 i-0a7eb3896d61b4d22 Krakencld-app-ASG-A running m5.large None browse_test
# ssh's to hosts listed from jws-grep output
if ! [ -z "$1" ]; then
echo "This script cannot be used interactively"
exit 1
fi
tmux set default-shell "/bin/sh"
# tmux new-window 'sleep 0.1'
while IFS='$\n' read -r i; do
ip=$(echo "$i" | awk '{print $2}')
tmux split-window "ssh $ip"
tmux select-layout tiled
done
tmux set -u default-shell
# tmux select-layout tiled
# tmux setw synchronize-panes on
# todo?
# if one result, directly ssh
# if more than one result, do new window tmux madness