Module: OsCtl::Lib::Utils::Send

Defined in:
lib/libosctl/utils/migration.rb

Instance Method Summary collapse

Instance Method Details

#send_ssh_cmd(key_chain, m_opts, cmd) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/libosctl/utils/migration.rb', line 3

def send_ssh_cmd(key_chain, m_opts, cmd)
  ret = [
    'ssh',
    '-o', 'StrictHostKeyChecking=no',
    '-T',
    '-p', m_opts[:port].to_s
  ]

  ret.push('-i', key_chain.private_key_path) if key_chain

  ret.push(
    '-l', 'osctl-ct-receive',
    m_opts[:dst],
    *cmd
  )
end