From c109e0e7dd8dd7a0a1c6f34baacddc09976744e9 Mon Sep 17 00:00:00 2001 From: Shivam Sandbhor Date: Fri, 7 Jan 2022 21:23:56 +0530 Subject: [PATCH] Add option to print machine creds (#1149) * Add option to print machine creds Signed-off-by: Shivam Sandbhor --- cmd/crowdsec-cli/machines.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crowdsec-cli/machines.go b/cmd/crowdsec-cli/machines.go index 2d7a9241b..d164af9d6 100644 --- a/cmd/crowdsec-cli/machines.go +++ b/cmd/crowdsec-cli/machines.go @@ -256,7 +256,7 @@ cscli machines add MyTestMachine --password MyPassword if err != nil { log.Fatalf("unable to marshal api credentials: %s", err) } - if dumpFile != "" { + if dumpFile != "" && dumpFile != "-" { err = ioutil.WriteFile(dumpFile, apiConfigDump, 0644) if err != nil { log.Fatalf("write api credentials in '%s' failed: %s", dumpFile, err)