summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--args.go6
-rw-r--r--main.go12
2 files changed, 13 insertions, 5 deletions
diff --git a/args.go b/args.go
index 0b858ac..1bc121c 100644
--- a/args.go
+++ b/args.go
@@ -11,9 +11,9 @@ import (
)
var args struct {
- ListRepos bool `arg:"--list-repos" help:"list all repositories"`
- Port int `arg:"--port" help:"port to run on (default is 2520)"`
- Hostname string `arg:"--hostname" help:"hostname to use"`
+ ListRepos bool `arg:"--list-repos" help:"list all repositories"`
+ Port int `arg:"--port" help:"port to run on (default is 2520)"`
+ Hostname string `arg:"--hostname" help:"hostname to use"`
}
func init() {
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)