summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-08 13:42:42 -0500
committerJeff Carr <[email protected]>2024-10-08 13:42:42 -0500
commit52fc6a840d00d38ffbf19edec867430973ae8144 (patch)
treece3313ef4fcc0d8e82d69aec8faab44169114680 /main.go
parent0e3fc9cb80f80f62aa737b659182e75588411c85 (diff)
/lastoutage dumps everythingv0.0.4
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.go b/main.go
index 02e3144..96e0f13 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ import (
"time"
"go.wit.com/log"
+ "go.wit.com/lib/gui/shell"
)
// var accessf, clientf *os.File
@@ -31,11 +32,18 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
// requrl := parts[0]
if tmp == "/powersource" {
- fmt.Fprintln(w, "Utility Power")
+ fmt.Fprintln(w, "TODO: fix this")
return
}
if tmp == "/lastoutage" {
- fmt.Fprintln(w, "Blackout at 2024/09/25 20:21:57 for 33 sec.")
+ // r := shell.Output("", []string{"ls", "-l", "/"})
+ r := shell.Output("", []string{"pwrstat", "-status"})
+
+ // log.Info("ls -l / START")
+ // log.Info("ls -l / =", r.Stdout())
+ // log.Info("ls -l / END")
+
+ fmt.Fprintln(w, r.Stdout())
return
}
fmt.Fprintln(w, "UNKNOWN URL:", tmp)