diff options
Diffstat (limited to 'cmd/ship/host_v2.go')
| -rw-r--r-- | cmd/ship/host_v2.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/cmd/ship/host_v2.go b/cmd/ship/host_v2.go index 0d70f5d..dec8b59 100644 --- a/cmd/ship/host_v2.go +++ b/cmd/ship/host_v2.go | |||
| @@ -272,16 +272,13 @@ var hostStatusV2Cmd = &cobra.Command{ | |||
| 272 | caddyStatus, _ := client.RunSudo("systemctl is-active caddy") | 272 | caddyStatus, _ := client.RunSudo("systemctl is-active caddy") |
| 273 | dockerStatus, _ := client.RunSudo("systemctl is-active docker") | 273 | dockerStatus, _ := client.RunSudo("systemctl is-active docker") |
| 274 | 274 | ||
| 275 | resp := map[string]interface{}{ | 275 | // Print as JSON directly (custom response type) |
| 276 | "status": "ok", | 276 | fmt.Printf(`{"status":"ok","host":%q,"domain":%q,"caddy":%t,"docker":%t}`+"\n", |
| 277 | "host": hostName, | 277 | hostName, |
| 278 | "domain": hostConfig.BaseDomain, | 278 | hostConfig.BaseDomain, |
| 279 | "caddy": strings.TrimSpace(caddyStatus) == "active", | 279 | strings.TrimSpace(caddyStatus) == "active", |
| 280 | "docker": strings.TrimSpace(dockerStatus) == "active", | 280 | strings.TrimSpace(dockerStatus) == "active", |
| 281 | } | 281 | ) |
| 282 | |||
| 283 | // Use JSON encoder directly since this is a custom response | ||
| 284 | output.Print(&output.ListResponse{Status: "ok"}) // Placeholder | ||
| 285 | return nil | 282 | return nil |
| 286 | }, | 283 | }, |
| 287 | } | 284 | } |
