summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-08 06:44:56 -0600
committerJeff Carr <[email protected]>2024-11-08 06:44:56 -0600
commitf45c2ed21ec0cf0577aa6e8e3178a389a58334a3 (patch)
tree91a46599751e87ab3d30ed866573f596b1defb1c
parent121b23720b8510c5104a35b8ba9b1fd7dbbba639 (diff)
use go-cmd/cmdv0.0.6
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 96e0f13..111b76f 100644
--- a/main.go
+++ b/main.go
@@ -37,13 +37,14 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
if tmp == "/lastoutage" {
// r := shell.Output("", []string{"ls", "-l", "/"})
- r := shell.Output("", []string{"pwrstat", "-status"})
+ r := shell.Run([]string{"pwrstat", "-status"})
// log.Info("ls -l / START")
// log.Info("ls -l / =", r.Stdout())
// log.Info("ls -l / END")
- fmt.Fprintln(w, r.Stdout())
+ output := strings.Join(r.Stdout, "\n")
+ fmt.Fprintln(w, output)
return
}
fmt.Fprintln(w, "UNKNOWN URL:", tmp)