diff options
| author | Jeff Carr <[email protected]> | 2025-03-22 16:41:51 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-23 09:32:50 -0500 |
| commit | 9b4bbeea80e2d0ec25b3bf302996844790d924d5 (patch) | |
| tree | a9a62e3002bf237ffc53e132f863d4bc14e913b9 /send.go | |
| parent | 812c10091e764a930a25196b4adf310cafb2da78 (diff) | |
Diffstat (limited to 'send.go')
| -rw-r--r-- | send.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -72,8 +72,14 @@ func sendMachine(s string) error { os.Exit(0) } else if strings.HasPrefix(line, "apt install") { log.Info("machine install", line) - shell.RunRealtime([]string{"apt", "update"}) - shell.RunRealtime(strings.Split(line, " ")) + parts := strings.Fields(line) + if len(parts) > 1 { + cmd := []string{"apt", "update"} + cmd = append(cmd, parts[1:]...) + shell.RunRealtime(cmd) + } else { + log.Info("nothing to install for line:", line) + } } else { log.Info(me.urlbase, "is maybe not working GOT:", line) log.Info(me.urlbase, "fail count", me.failcount, "from hostname", me.machine.Hostname) |
