From 41beb5d19f6dfc7597e3577fcaa79c8d4d109a86 Mon Sep 17 00:00:00 2001 From: Herbert Date: Wed, 28 Jun 2017 18:38:47 +0200 Subject: [PATCH] Always exit with 0 --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 8719a42..ce8bacf 100644 --- a/main.go +++ b/main.go @@ -46,16 +46,16 @@ func main() { log.SetOutput(slog) } - cmd := exec.Command(*ipmiSel, "--output-event-state", "--comma-separated-output", "--no-header-output") + cmd := exec.Command(*ipmiSel, "--debug", "--output-event-state", "--comma-separated-output", "--no-header-output") var stdout, stderr bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr - if err := cmd.Run(); err != nil { - log.Fatalf("Failed running `%s` with error `%s`\n", *ipmiSel, err) - } - outStr, errStr := string(stdout.Bytes()), string(stderr.Bytes()) log.Printf("%s: stdout `%s`, stderr `%s`", *ipmiSel, outStr, errStr) + if err := cmd.Run(); err != nil { + log.Printf("Got error running `%s`: `%s`\n", *ipmiSel, err) + os.Exit(0) + } outStr = strings.TrimSpace(outStr) lines := strings.Split(outStr, "\n")