From 6df7276abf85701e3670500964e746bc5d690640 Mon Sep 17 00:00:00 2001 From: evan Date: Sat, 21 May 2022 17:44:16 -0500 Subject: [PATCH] restart remux, tarnish, draft --- main.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 61fd79e..79bead8 100644 --- a/main.go +++ b/main.go @@ -83,12 +83,15 @@ func main() { // Restart xochitl if *restart { - _, exitcode := exec.Command("systemctl", "is-active", "xochitl").CombinedOutput() - if exitcode == nil { - debug("Restarting xochitl") - stdout, err := exec.Command("systemctl", "restart", "xochitl").CombinedOutput() - if err != nil { - fmt.Println("xochitl restart failed with message:", string(stdout)) + services := []string{"xochitl", "remux", "tarnish", "draft"} + for _, service := range services { + _, exitcode := exec.Command("systemctl", "is-active", service).CombinedOutput() + if exitcode == nil { + debug("Restarting " + service) + stdout, err := exec.Command("systemctl", "restart", service).CombinedOutput() + if err != nil { + fmt.Println(service + " restart failed with message:", string(stdout)) + } } } }