define unit in README

This commit is contained in:
2022-03-20 23:44:30 -07:00
parent c8050d2258
commit e44344ee7d

View File

@@ -66,6 +66,7 @@ func main() {
defer cancel()
// Equivalent to `systemctl enable nginx` with a 10 second timeout
opts := systemctl.Options{ UserMode: false }
unit := "nginx"
err := systemctl.Enable(ctx, unit, opts)
if err != nil {
log.Fatalf("unable to enable unit %s: %v", "nginx", err)