rm some output

This commit is contained in:
Jeff Carr 2025-03-06 07:50:10 -06:00
parent 560162d2b2
commit 14ee66fe6a
2 changed files with 8 additions and 7 deletions

View File

@ -12,11 +12,11 @@ all: build
./zood ./zood
build: goimports build: goimports
GO111MODULE=off go build \ GO111MODULE=off go build -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: install:
GO111MODULE=off go install \ GO111MODULE=off go install -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
sudo: build sudo: build

11
send.go
View File

@ -53,21 +53,22 @@ func sendMachine(s string) error {
return err return err
} }
out := strings.TrimSpace(string(body)) out := strings.TrimSpace(string(body))
log.Info("httpPost() data:", out, len(body)) // log.Info("httpPost() data:", out, len(body))
test := strings.TrimSpace(string(body)) test := strings.TrimSpace(string(body))
// log.Info("virtigo returned body:", test) // log.Info("virtigo returned body:", test)
for _, line := range strings.Split(test, "\n") { for _, line := range strings.Split(test, "\n") {
if line == "upgrade" { if line == "good" {
log.Info(s, "zookeeper is healthy") log.Info(s, "zookeeper is healthy")
me.failcount = 0 me.failcount = 0
} else if line == "kill" { } else if line == "kill" {
os.Exit(0) os.Exit(0)
} else if strings.HasPrefix(line, "apt update") { } else if strings.HasPrefix(line, "apt update") {
log.Info("machine upgrade now", line) log.Info("machine upgrade now", line)
shell.Run([]string{"apt", "update"}) shell.RunRealtime([]string{"mv", "-f", "/usr/bin/zood", "/usr/bin/zood.last"})
shell.Run([]string{"apt", "install", "zood"}) shell.RunRealtime([]string{"apt", "update"})
log.Sleep(1) shell.RunRealtime([]string{"apt", "install", "zood"})
shell.RunRealtime([]string{"rm", "-f", "/usr/bin/zood.last"})
os.Exit(0) os.Exit(0)
} else { } else {
log.Info(me.urlbase, "is maybe not working GOT:", line) log.Info(me.urlbase, "is maybe not working GOT:", line)