summaryrefslogtreecommitdiff
path: root/cmd/dgrep
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/dgrep
parent02f60d098e659cee33e42f501b2b07508abbae0a (diff)
can specify a private ssh key via command line, no password support yet though
Diffstat (limited to 'cmd/dgrep')
-rw-r--r--cmd/dgrep/main.go17
1 files changed, 10 insertions, 7 deletions
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(&regex, "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)