From 6fc5aa32a7478b7976daee62e01bc7ebd2a0a1a8 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 10 Sep 2022 13:01:03 +0000 Subject: [PATCH] sparkles: Add manual-install --- cmd/agent/main.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index 543fcf0..3c61ecf 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -199,6 +199,42 @@ This command is meant to be used from the boot GRUB menu, but can be also starte return agent.InteractiveInstall(c.Bool("shell")) }, }, + { + Name: "manual-install", + Usage: "Starts the manual installation", + Description: ` +`, + Aliases: []string{"m"}, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "device", + }, + &cli.BoolFlag{ + Name: "poweroff", + }, + &cli.BoolFlag{ + Name: "reboot", + }, + }, + Action: func(c *cli.Context) error { + if c.NArg() == 0 { + return fmt.Errorf("expect one argument. the config file - if you don't have it, use the interactive-install") + } + config := c.Args().First() + + options := map[string]string{"device": c.String("device")} + + if c.Bool("poweroff") { + options["poweroff"] = "true" + } + + if c.Bool("reboot") { + options["reboot"] = "true" + } + return agent.ManualInstall(config, options) + }, + }, + { Name: "install", Usage: "Starts the c3os pairing installation",