Skip to content

Instantly share code, notes, and snippets.

@nuno1212s
Created July 7, 2022 01:24
Show Gist options
  • Save nuno1212s/14b305ed20a133ee6a4eadebd1af6eeb to your computer and use it in GitHub Desktop.
Save nuno1212s/14b305ed20a133ee6a4eadebd1af6eeb to your computer and use it in GitHub Desktop.
Toma lá
#!/bin/bash
MACHINES=("safe01" "safe02" "safe03" "safe04" "safe-gpu" "cop01" "cop02" "cop03" "cop04")
SESSION_NAME="ClusterDcc"
tmux kill-session -t $SESSION_NAME
tmux new-session -ds $SESSION_NAME
USER="nneto"
i=0
for machine in "${MACHINES[@]}"
do
echo "Machine ${machine}"
i=$((i+1))
tmux new-window -t $SESSION_NAME:${i} -n "${machine}"
tmux send-keys -t $SESSION_NAME:${i} "ssh -J ihaveakey@jump.dcc.fc.up.pt ${USER}@${machine}.dcc.fc.up.pt " KPEnter
done
tmux kill-window -t $SESSION_NAME:0
tmux a -t $SESSION_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment