sshCommand method

List<String> sshCommand({
  1. required bool ipv6,
  2. required String sshTarget,
  3. required String command,
  4. bool addHostToKnownHosts = false,
  5. bool lastCommand = false,
  6. String endCharacter = ';',
})

Implementation

List<String> sshCommand({
  required bool ipv6,
  required String sshTarget,
  required String command,
  bool addHostToKnownHosts = false,
  bool lastCommand = false,
  String endCharacter = ';',
}) =>
    [
      'ssh',
      '-o',
      'BatchMode=yes',
      if (addHostToKnownHosts) ...[
        '-o',
        'StrictHostKeyChecking=accept-new',
      ],
      if (ipv6) '-6',
      sshTarget,
      '$command ${lastCommand ? '' : endCharacter}',
    ];