diff options
-rw-r--r-- | cmd/bookpipeline/main.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go index bf31cf1..7ec57c9 100644 --- a/cmd/bookpipeline/main.go +++ b/cmd/bookpipeline/main.go @@ -794,17 +794,18 @@ func main() { log.Println("Error during analysis", err) } case <-shutdownIfQuiet.C: - if *autoshutdown { - conn.Log("Shutting down") - cmd := exec.Command("sudo", "systemctl", "poweroff") - var stdout, stderr bytes.Buffer - cmd.Stdout = &stdout - cmd.Stderr = &stderr - err := cmd.Run() - if err != nil { - conn.Log("Error shutting down, error:", err, - ", stdout: ", stdout.String(), ", stderr: ", stderr.String()) - } + if !*autoshutdown { + continue + } + conn.Log("Shutting down") + cmd := exec.Command("sudo", "systemctl", "poweroff") + var stdout, stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + err := cmd.Run() + if err != nil { + conn.Log("Error shutting down, error:", err, + ", stdout: ", stdout.String(), ", stderr: ", stderr.String()) } } } |