1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 22:32:14 +00:00

Implement bootcmd

This commit is contained in:
Josh Curl
2016-11-03 15:06:20 -07:00
parent 33b6145162
commit bb4ad618e1
6 changed files with 34 additions and 14 deletions

View File

@@ -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)
}
}
}