diff --git a/cmd/meta_cli/main.go b/cmd/meta_cli/main.go index a357991..9782b5f 100644 --- a/cmd/meta_cli/main.go +++ b/cmd/meta_cli/main.go @@ -7,6 +7,7 @@ import ( configuration "git.g3e.fr/syonad/two/internal/config/agent" "git.g3e.fr/syonad/two/internal/load_db/nocloud" "git.g3e.fr/syonad/two/pkg/db/kv" + "git.g3e.fr/syonad/two/pkg/systemd" ) func main() { @@ -22,6 +23,8 @@ func main() { flag.Parse() + service, _ := systemd.New() + conf, err := configuration.LoadConfig(*conf_file) if err != nil { fmt.Println(err) @@ -43,7 +46,9 @@ func main() { Password: *password, SSHKEY: *ssh_key, }, db) + service.Start("metadata@" + *vm_name) } else if *stop { nocloud.UnLoadNoCloudInDB(*vm_name, db) + service.Stop("metadata@" + *vm_name) } }