Fix no-op when set property of a jail with fullname (datastore/jail)
This commit is contained in:
parent
ed5f8f0b1c
commit
87e9ae894a
@ -105,20 +105,21 @@ func SetJailProperties(args []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get jail by index to modify it
|
cj, err := getJailFromArray(jail.Name, []string{""}, gJails)
|
||||||
for i, _ := range gJails {
|
if err != nil {
|
||||||
if gJails[i].Name == jail.Name {
|
fmt.Printf("Error getting jail %s: %v\n", jail.Name, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for _, p := range props {
|
for _, p := range props {
|
||||||
err := setStructFieldValue(&gJails[i], p.name, p.value)
|
err := setStructFieldValue(cj, p.name, p.value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error: %s\n", err.Error())
|
fmt.Printf("Error: %s\n", err.Error())
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%s: %s set to %s\n", gJails[i].Name, p.name, p.value)
|
fmt.Printf("%s: %s set to %s\n", cj.Name, p.name, p.value)
|
||||||
gJails[i].ConfigUpdated = true
|
cj.ConfigUpdated = true
|
||||||
}
|
|
||||||
}
|
|
||||||
writeConfigToDisk(&gJails[i], false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
writeConfigToDisk(cj, false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user