Formatting + add "set" command

This commit is contained in:
yo 2022-04-02 17:11:54 +02:00
parent bf20c815ce
commit 5a3d26a52c

View File

@ -34,7 +34,6 @@ var (
Short: "GoCage is a FreeBSD Jail management tool",
Long: `GoCage is a jail management tool. It support VNET, host-only, NAT networks. Provides snapshots and cloning.
It support iocage jails and can coexist with iocage.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Here we are in the Run")
cleanAfterRun()
@ -95,6 +94,19 @@ ex: gocage list srv-db srv-web`,
cleanAfterRun()
},
}
setCmd = &cobra.Command{
Use: "set",
Short: "Set a jail property",
Long: `Set jail property value. Specify property=value, end command with jail name.
Multiples properties can be specified, separated with space (Ex: gocage set allow_mlock=1 boot=1 myjail)`,
Run: func(cmd *cobra.Command, args []string) {
// Get the inventory
ListJails(args, false)
SetJailProperties(args)
cleanAfterRun()
},
}
)
@ -118,6 +130,7 @@ func init() {
listCmd.AddCommand(listPropsCmd)
rootCmd.AddCommand(stopCmd)
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(setCmd)
// Get FreeBSD version
out, err := executeCommand("freebsd-version")