mirror of
https://github.com/sstent/dotfiles.git
synced 2026-01-25 16:41:45 +00:00
Add sshnode
This commit is contained in:
26
bin/sshnodes.sh
Executable file
26
bin/sshnodes.sh
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Set Session Name
|
||||||
|
SESSION="sshnodes"
|
||||||
|
SESSIONEXISTS=$(tmux list-sessions | grep $SESSION)
|
||||||
|
|
||||||
|
# Only create tmux session if it doesn't already exist
|
||||||
|
if [ "$SESSIONEXISTS" = "" ]
|
||||||
|
then
|
||||||
|
# Start New Session with our name
|
||||||
|
tmux new-session -d -s $SESSION
|
||||||
|
tmux rename-window -t sshnodes
|
||||||
|
tmux split-window -v
|
||||||
|
tmux split-window -h
|
||||||
|
tmux selectp -t 0
|
||||||
|
tmux split-window -h
|
||||||
|
tmux send-keys -t 0 "autossh odroid1" C-m
|
||||||
|
tmux send-keys -t 1 "autossh odroid2" C-m
|
||||||
|
tmux send-keys -t 2 "autossh odroid3" C-m
|
||||||
|
tmux send-keys -t 3 "autossh odroid4" C-m
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Attach Session, on the Main window
|
||||||
|
tmux attach-session -t $SESSION:0
|
||||||
|
|
||||||
Reference in New Issue
Block a user