From 724b6c82f591ec696f14dfb7d6e8e133eff1072f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 20 May 2020 14:10:56 +0100 Subject: can specify a private ssh key via command line, no password support yet though --- cmd/dgrep/main.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'cmd/dgrep') diff --git a/cmd/dgrep/main.go b/cmd/dgrep/main.go index c136b43..faffe76 100644 --- a/cmd/dgrep/main.go +++ b/cmd/dgrep/main.go @@ -27,6 +27,7 @@ func main() { var quietEnable bool var sshPort int var trustAllHosts bool + var privateKeyPathFile string userName := user.Name() @@ -43,6 +44,7 @@ func main() { flag.StringVar(®ex, "regex", ".", "Regular expression") 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() @@ -57,13 +59,14 @@ func main() { logger.Start(ctx, logger.Modes{Debug: debugEnable || config.Common.DebugEnable, Quiet: quietEnable}) args := clients.Args{ - ConnectionsPerCPU: connectionsPerCPU, - ServersStr: serversStr, - Discovery: discovery, - UserName: userName, - What: files, - TrustAllHosts: trustAllHosts, - Regex: regex, + ConnectionsPerCPU: connectionsPerCPU, + ServersStr: serversStr, + Discovery: discovery, + UserName: userName, + What: files, + TrustAllHosts: trustAllHosts, + Regex: regex, + PrivateKeyPathFile: privateKeyPathFile, } client, err := clients.NewGrepClient(args) -- cgit v1.2.3