summaryrefslogtreecommitdiff
path: root/cmd/drun
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-05-20 14:10:56 +0100
committerPaul Buetow <pbuetow@mimecast.com>2020-05-20 14:10:56 +0100
commit724b6c82f591ec696f14dfb7d6e8e133eff1072f (patch)
tree98fffb253e0408f52ec39324c377b7db4a6ae79d /cmd/drun
parent02f60d098e659cee33e42f501b2b07508abbae0a (diff)
can specify a private ssh key via command line, no password support yet though
Diffstat (limited to 'cmd/drun')
-rw-r--r--cmd/drun/main.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/cmd/drun/main.go b/cmd/drun/main.go
index 039c104..8c78e8f 100644
--- a/cmd/drun/main.go
+++ b/cmd/drun/main.go
@@ -31,6 +31,7 @@ func main() {
var sshPort int
var timeout int
var trustAllHosts bool
+ var privateKeyPathFile string
userName := user.Name()
@@ -49,6 +50,7 @@ func main() {
flag.StringVar(&jobName, "name", "", "The job name (if run in background)")
flag.StringVar(&serversStr, "servers", "", "Remote servers to connect")
flag.StringVar(&userName, "user", userName, "Your system user name")
+ flag.StringVar(&privateKeyPathFile, "key", "", "Path to private key")
flag.Parse()
@@ -64,14 +66,15 @@ func main() {
command, commandArgs := readCommand(command)
args := clients.Args{
- ConnectionsPerCPU: connectionsPerCPU,
- ServersStr: serversStr,
- Discovery: discovery,
- UserName: userName,
- What: command,
- Arguments: commandArgs,
- TrustAllHosts: trustAllHosts,
- Timeout: timeout,
+ ConnectionsPerCPU: connectionsPerCPU,
+ ServersStr: serversStr,
+ Discovery: discovery,
+ UserName: userName,
+ What: command,
+ Arguments: commandArgs,
+ TrustAllHosts: trustAllHosts,
+ Timeout: timeout,
+ PrivateKeyPathFile: privateKeyPathFile,
}
client, err := clients.NewRunClient(args, background, jobName)