Add "gocage get all myjail"

This commit is contained in:
yo
2022-04-03 11:04:01 +02:00
parent 19dd2dfb33
commit 285229009f
3 changed files with 21 additions and 2 deletions

View File

@ -112,7 +112,8 @@ Multiples properties can be specified, separated with space (Ex: gocage set allo
Use: "get",
Short: "Get a jail property",
Long: `Get jail property value. Specify property, end command with jail name.
Multiples properties can be specified, separated with space (Ex: gocage get allow_mlock boot myjail)`,
Multiples properties can be specified, separated with space (Ex: gocage get allow_mlock boot myjail)
For all properties specify "all" (Ex: gocage get all myjail)`,
Run: func(cmd *cobra.Command, args []string) {
// Get the inventory
ListJails(args, false)
@ -201,7 +202,6 @@ func initConfig() {
func cleanAfterRun() {
for _, j := range gJails {
if j.ConfigUpdated {
//fmt.Printf("Config for jail %s will be updated\n", j.Name)
marshaled, err := json.MarshalIndent(j.Config, "", " ")
if err != nil {
fmt.Printf("ERROR marshaling config: %s\n", err.Error())