Fix setting Running to false
This commit is contained in:
parent
efd28c03ad
commit
9b86d786fe
17
cmd/stop.go
17
cmd/stop.go
@ -360,8 +360,19 @@ func StopJail(args []string) {
|
||||
fmt.Printf("Error deleting parameter file %s\n", pfile)
|
||||
}
|
||||
|
||||
cj.InternalName = ""
|
||||
cj.Running = false
|
||||
cj.JID = 0
|
||||
// We need this to get a reference to cj.Running (bc cj.Running is just a copy of value in the scope of StopJail())
|
||||
for i, j := range gJails {
|
||||
if strings.EqualFold(j.Name, cj.Name) && strings.EqualFold(j.Datastore, cj.Datastore) {
|
||||
if err = setStructFieldValue(&gJails[i], "Running", "false"); err != nil {
|
||||
fmt.Printf("ERROR: setting Running property to false: %s\n", err.Error())
|
||||
}
|
||||
if err = setStructFieldValue(&gJails[i], "JID", "0"); err != nil {
|
||||
fmt.Printf("ERROR: setting JID property to 0: %s\n", err.Error())
|
||||
}
|
||||
if err = setStructFieldValue(&gJails[i], "InternalName", ""); err != nil {
|
||||
fmt.Printf("ERROR: clearing InternalName property: %s\n", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user