mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-10 13:29:09 +00:00
Only run sysext commands if binary is on path
Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
8
main.go
8
main.go
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
@@ -809,6 +810,13 @@ The validate command expects a configuration file as its only argument. Local fi
|
||||
Name: "sysext",
|
||||
Usage: "sysext subcommands",
|
||||
Description: "sysext subcommands",
|
||||
Before: func(c *cli.Context) error {
|
||||
_, err := exec.LookPath("systemd-sysext")
|
||||
if err != nil {
|
||||
return fmt.Errorf("systemd-sysext not found in PATH")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "list",
|
||||
|
Reference in New Issue
Block a user