FIXME: Update release in config file when stopping jail
This commit is contained in:
parent
9c18a83ee8
commit
89db166040
13
cmd/stop.go
13
cmd/stop.go
@ -236,6 +236,16 @@ func StopJail(args []string) {
|
|||||||
|
|
||||||
fmt.Printf("> Stopping jail %s\n", a)
|
fmt.Printf("> Stopping jail %s\n", a)
|
||||||
|
|
||||||
|
// Get current version to update config.json
|
||||||
|
cvers, err := executeCommandInJail(cj, "/bin/freebsd-version")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("ERROR: %s\n", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cvers = strings.TrimRight(cvers, "\n")
|
||||||
|
fmt.Sprintf(cj.Config.Release, cvers)
|
||||||
|
cj.ConfigUpdated = true
|
||||||
|
|
||||||
out, err := executeCommand(fmt.Sprintf("rctl jail:%s", cj.InternalName))
|
out, err := executeCommand(fmt.Sprintf("rctl jail:%s", cj.InternalName))
|
||||||
if err == nil && len(out) > 0 {
|
if err == nil && len(out) > 0 {
|
||||||
fmt.Printf(" > Remove RCTL rules:\n")
|
fmt.Printf(" > Remove RCTL rules:\n")
|
||||||
@ -399,5 +409,8 @@ func StopJail(args []string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WriteConfigToDisk(cj.Name, false, true)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user