Skip to content

Commit

Permalink
Merge pull request #1064 from gravitational/nikatjef-nikatjef/ssh_com…
Browse files Browse the repository at this point in the history
…patibility

Nikatjef nikatjef/ssh compatibility
  • Loading branch information
kontsevoy authored Jun 12, 2017
2 parents f697a0b + b3af9d4 commit 7eaa823
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tool/tsh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@ limitations under the License.

package main

import (
"github.com/gravitational/teleport/tool/tsh/common"
)

import (
"os"
"path"

"github.com/gravitational/teleport/tool/tsh/common"
)

func main() {
common.Run(os.Args[1:], false)
cmd_line_orig := os.Args[1:]
cmd_line := []string{}

// lets see: if the executable name is 'ssh' or 'scp' we convert
// that to "tsh ssh" or "tsh scp"
switch path.Base(os.Args[0]) {
case "ssh":
cmd_line = append([]string{"ssh"}, cmd_line_orig...)
case "scp":
cmd_line = append([]string{"scp"}, cmd_line_orig...)
default:
cmd_line = cmd_line_orig
}
common.Run(cmd_line, false)
}

0 comments on commit 7eaa823

Please sign in to comment.