Created
September 24, 2012 16:28
-
-
Save florianleibert/3776855 to your computer and use it in GitHub Desktop.
Mult-SSH
This file contains hidden or 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
tell application "iTerm" | |
activate | |
make new terminal | |
set Names to paragraphs of (read (choose file with prompt "File with hostnames") ) | |
repeat with nextLine in Names | |
if length of nextLine is greater than 0 then | |
set cmd to "ssh ubuntu@" & nextLine | |
my open_tab(nextLine, cmd) | |
end if | |
end repeat | |
set the name of the last window to "ec2" | |
end tell | |
on open_tab(title, command) | |
tell application "iTerm" to tell last terminal | |
launch session "ec2" | |
tell last session | |
write text command | |
set name to title | |
end tell | |
end tell | |
end open_tab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment