Formatting + add "set" command
This commit is contained in:
parent
bf20c815ce
commit
5a3d26a52c
15
cmd/root.go
15
cmd/root.go
@ -34,7 +34,6 @@ var (
|
|||||||
Short: "GoCage is a FreeBSD Jail management tool",
|
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.
|
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.`,
|
It support iocage jails and can coexist with iocage.`,
|
||||||
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println("Here we are in the Run")
|
fmt.Println("Here we are in the Run")
|
||||||
cleanAfterRun()
|
cleanAfterRun()
|
||||||
@ -95,6 +94,19 @@ ex: gocage list srv-db srv-web`,
|
|||||||
cleanAfterRun()
|
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)
|
listCmd.AddCommand(listPropsCmd)
|
||||||
rootCmd.AddCommand(stopCmd)
|
rootCmd.AddCommand(stopCmd)
|
||||||
rootCmd.AddCommand(startCmd)
|
rootCmd.AddCommand(startCmd)
|
||||||
|
rootCmd.AddCommand(setCmd)
|
||||||
|
|
||||||
// Get FreeBSD version
|
// Get FreeBSD version
|
||||||
out, err := executeCommand("freebsd-version")
|
out, err := executeCommand("freebsd-version")
|
||||||
|
Loading…
Reference in New Issue
Block a user