process runcmd
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
parent
0deecce2de
commit
465cb76917
@ -19,7 +19,9 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/vtolstov/cloudinit/config"
|
||||
"github.com/vtolstov/cloudinit/network"
|
||||
@ -70,6 +72,12 @@ func Apply(cfg config.CloudConfig, ifaces []network.InterfaceGenerator, env *Env
|
||||
log.Printf("Set hostname to %s", cfg.Hostname)
|
||||
}
|
||||
|
||||
for _, cmdline := range cfg.RunCMD {
|
||||
prog := strings.Fields(cmdline)[0]
|
||||
args := strings.Fields(cmdline)[1:]
|
||||
exec.Command(prog, args...).Run()
|
||||
}
|
||||
|
||||
for _, user := range cfg.Users {
|
||||
if user.Name == "" {
|
||||
log.Printf("User object has no 'name' field, skipping")
|
||||
|
Loading…
Reference in New Issue
Block a user