diff options
| -rw-r--r-- | main.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |
