restart remux, tarnish, draft

This commit is contained in:
evan 2022-05-21 17:44:16 -05:00
parent 37c00b6a5c
commit 6df7276abf

11
main.go
View file

@ -83,12 +83,15 @@ func main() {
// Restart xochitl // Restart xochitl
if *restart { if *restart {
_, exitcode := exec.Command("systemctl", "is-active", "xochitl").CombinedOutput() services := []string{"xochitl", "remux", "tarnish", "draft"}
for _, service := range services {
_, exitcode := exec.Command("systemctl", "is-active", service).CombinedOutput()
if exitcode == nil { if exitcode == nil {
debug("Restarting xochitl") debug("Restarting " + service)
stdout, err := exec.Command("systemctl", "restart", "xochitl").CombinedOutput() stdout, err := exec.Command("systemctl", "restart", service).CombinedOutput()
if err != nil { if err != nil {
fmt.Println("xochitl restart failed with message:", string(stdout)) fmt.Println(service + " restart failed with message:", string(stdout))
}
} }
} }
} }