mirror of
https://github.com/taigrr/systemctl.git
synced 2026-03-09 00:14:38 -07:00
define unit in README
This commit is contained in:
@@ -66,6 +66,7 @@ func main() {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
// Equivalent to `systemctl enable nginx` with a 10 second timeout
|
// Equivalent to `systemctl enable nginx` with a 10 second timeout
|
||||||
opts := systemctl.Options{ UserMode: false }
|
opts := systemctl.Options{ UserMode: false }
|
||||||
|
unit := "nginx"
|
||||||
err := systemctl.Enable(ctx, unit, opts)
|
err := systemctl.Enable(ctx, unit, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("unable to enable unit %s: %v", "nginx", err)
|
log.Fatalf("unable to enable unit %s: %v", "nginx", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user