mirror of
https://github.com/Evidlo/remarkable_printer.git
synced 2024-10-20 03:27:37 -04:00
restart remux, tarnish, draft
This commit is contained in:
parent
37c00b6a5c
commit
6df7276abf
11
main.go
11
main.go
|
@ -83,12 +83,15 @@ func main() {
|
|||
|
||||
// Restart xochitl
|
||||
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 {
|
||||
debug("Restarting xochitl")
|
||||
stdout, err := exec.Command("systemctl", "restart", "xochitl").CombinedOutput()
|
||||
debug("Restarting " + service)
|
||||
stdout, err := exec.Command("systemctl", "restart", service).CombinedOutput()
|
||||
if err != nil {
|
||||
fmt.Println("xochitl restart failed with message:", string(stdout))
|
||||
fmt.Println(service + " restart failed with message:", string(stdout))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue