From 14ee66fe6ac3fc995ee04b4628d2a1bf874d73e1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 6 Mar 2025 07:50:10 -0600 Subject: [PATCH] rm some output --- Makefile | 4 ++-- send.go | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a3b993c..636eafb 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,11 @@ all: build ./zood 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}" install: - GO111MODULE=off go install \ + GO111MODULE=off go install -v -x \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" sudo: build diff --git a/send.go b/send.go index 2636d5c..6b5273c 100644 --- a/send.go +++ b/send.go @@ -53,21 +53,22 @@ func sendMachine(s string) error { return err } out := strings.TrimSpace(string(body)) - log.Info("httpPost() data:", out, len(body)) + // log.Info("httpPost() data:", out, len(body)) test := strings.TrimSpace(string(body)) // log.Info("virtigo returned body:", test) for _, line := range strings.Split(test, "\n") { - if line == "upgrade" { + if line == "good" { log.Info(s, "zookeeper is healthy") me.failcount = 0 } else if line == "kill" { os.Exit(0) } else if strings.HasPrefix(line, "apt update") { log.Info("machine upgrade now", line) - shell.Run([]string{"apt", "update"}) - shell.Run([]string{"apt", "install", "zood"}) - log.Sleep(1) + shell.RunRealtime([]string{"mv", "-f", "/usr/bin/zood", "/usr/bin/zood.last"}) + shell.RunRealtime([]string{"apt", "update"}) + shell.RunRealtime([]string{"apt", "install", "zood"}) + shell.RunRealtime([]string{"rm", "-f", "/usr/bin/zood.last"}) os.Exit(0) } else { log.Info(me.urlbase, "is maybe not working GOT:", line)