Files
atlantis/server/ssh_util.go
Luke Kysow d1bda5ff28 Use cobra and viper for cli/config (#20)
* #15 Use cobra and viper for cli/config

* Run gofmt
2017-06-07 21:20:37 -07:00

14 lines
447 B
Go

package server
import "io/ioutil"
// todo: make this object oriented
const defaultSSHWrapper = "/tmp/git-ssh.sh"
// Create git ssh wrapper
func GenerateSSHWrapper() error {
d1 := []byte("#!/bin/sh\nif [ -z \"$PKEY\" ]; then\n# if PKEY is not specified, run ssh using default keyfile\nssh -oStrictHostKeyChecking=no \"$@\"\nelse\nssh -oStrictHostKeyChecking=no -i \"$PKEY\" \"$@\"\nfi")
return ioutil.WriteFile(defaultSSHWrapper, d1, 0755)
}