Skip to content

Instantly share code, notes, and snippets.

@florianleibert
Created September 24, 2012 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florianleibert/3776855 to your computer and use it in GitHub Desktop.
Save florianleibert/3776855 to your computer and use it in GitHub Desktop.
Mult-SSH
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