fixed runCommand
This commit is contained in:
parent
21c99ce8f6
commit
1b14fcbea4
3
main.go
3
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)
|
||||
|
Loading…
Reference in New Issue
Block a user