From 1b14fcbea45afa2086cf67d1ed2630150678b726 Mon Sep 17 00:00:00 2001 From: Niklas Date: Tue, 27 Oct 2020 22:17:37 +0100 Subject: [PATCH] fixed runCommand --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 59472ce..7a8c654 100644 --- a/main.go +++ b/main.go @@ -140,12 +140,13 @@ func block(config sunsetConfig, command string) { nextHr, nextMin := getNextWait(config) timer := time.NewTimer((time.Duration(nextHr) * time.Hour) + (time.Duration(nextMin) * time.Minute)) <-timer.C + log.Printf("Running command: %s\n", command) go runCommand(command) } } func runCommand(command string) { - cmd := exec.Command("/usr/bin/env sh", "-c", command) + cmd := exec.Command("/usr/bin/env", "sh", "-c", command) err := cmd.Run() if err != nil { log.Printf("Command %s returned a non 0 code", command)