浏览代码

Add option to print machine creds (#1149)

* Add option to print machine creds

Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Shivam Sandbhor 3 年之前
父节点
当前提交
c109e0e7dd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      cmd/crowdsec-cli/machines.go

+ 1 - 1
cmd/crowdsec-cli/machines.go

@@ -256,7 +256,7 @@ cscli machines add MyTestMachine --password MyPassword
 			if err != nil {
 			if err != nil {
 				log.Fatalf("unable to marshal api credentials: %s", err)
 				log.Fatalf("unable to marshal api credentials: %s", err)
 			}
 			}
-			if dumpFile != "" {
+			if dumpFile != "" && dumpFile != "-" {
 				err = ioutil.WriteFile(dumpFile, apiConfigDump, 0644)
 				err = ioutil.WriteFile(dumpFile, apiConfigDump, 0644)
 				if err != nil {
 				if err != nil {
 					log.Fatalf("write api credentials in '%s' failed: %s", dumpFile, err)
 					log.Fatalf("write api credentials in '%s' failed: %s", dumpFile, err)