Last active
June 15, 2016 10:48
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 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