summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bookpipeline/main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go
index 8317f3b..bf31cf1 100644
--- a/cmd/bookpipeline/main.go
+++ b/cmd/bookpipeline/main.go
@@ -795,7 +795,16 @@ func main() {
}
case <-shutdownIfQuiet.C:
if *autoshutdown {
- log.Println("If I was sufficiently brave, now would be the time I would shut down")
+ 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())
+ }
}
}
}