Module: Ec2Ssh::Cli::Utils

Defined in:
lib/ec2-ssh/utils.rb

Instance Method Summary collapse

Instance Method Details

#open_in_terminalObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ec2-ssh/utils.rb', line 2

def open_in_terminal
  @all_servers.each do |server|
    `osascript <<-eof
      tell application "iTerm"
        tell current window
          create tab with default profile
          tell the current tab
            activate current session
            tell the last session
              set name to "#{server}"
              write text "ssh -o StrictHostKeyChecking=no ec2-user@#{server}"
            end tell
          end tell
        end tell
      end tell
    eof`
  end
end