diff options
| author | Jeff Carr <[email protected]> | 2025-03-23 18:20:13 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-23 18:23:45 -0500 |
| commit | a02078081e445a806cd0d103f452b5154ac4b967 (patch) | |
| tree | ccdc8dd242fabd2e6e1aca8930493441f2ced8cf /send.go | |
| parent | 9b4bbeea80e2d0ec25b3bf302996844790d924d5 (diff) | |
correctly recover if 'apt install' doesn't workv0.0.63
Diffstat (limited to 'send.go')
| -rw-r--r-- | send.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -68,7 +68,12 @@ func sendMachine(s string) error { 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"}) + if shell.Exists("/usr/bin/zood") { + shell.RunRealtime([]string{"rm", "-f", "/usr/bin/zood.last"}) + } else { + // there is not a new version of the binary. move the old one back + shell.RunRealtime([]string{"mv", "-f", "/usr/bin/zood.last", "/usr/bin/zood"}) + } os.Exit(0) } else if strings.HasPrefix(line, "apt install") { log.Info("machine install", line) |
