Skip to content

Instantly share code, notes, and snippets.

@cbiggins
Last active June 15, 2016 10:48
Show Gist options
  • Save cbiggins/ee50226e0ce953c0624a to your computer and use it in GitHub Desktop.
Save cbiggins/ee50226e0ce953c0624a to your computer and use it in GitHub Desktop.
Opens new iTerm window and connects to an array of servers each in their own tab
(* set to the user of the box, ie "root" or "deployer" *)
set box_user to "user"
(* Add the hostnames or IP's of the boxes to connect to. As many as you need. *)
set my_boxes to {"box1", "box2", "box3"}
tell application "iTerm"
activate
set t to (make new terminal)
tell t
(* Loop over the boxes, create a new tab and connect. *)
repeat with box in my_boxes
activate current session
launch session "Default Session"
tell the last session
set conn to "ssh " & box_user & "@" & box
write text conn
end tell
end repeat
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment