mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +00:00
Implement bootcmd
This commit is contained in:
15
util/util.go
15
util/util.go
@@ -268,3 +268,18 @@ func RunScript(path string) error {
|
||||
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func RunCommandSequence(commandSequence [][]string) {
|
||||
for _, command := range commandSequence {
|
||||
if len(command) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
cmd := exec.Command(command[0], command[1:]...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Errorf("Failed to run %s: %v", command, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user