v0.36c: Moved and renamed writeConfigToDisk into utils.go

This commit is contained in:
yo
2023-07-23 15:52:21 +02:00
parent 24439a8181
commit bce37e6541
7 changed files with 76 additions and 68 deletions

View File

@ -283,15 +283,8 @@ func StopJail(args []string) {
fmt.Printf("> Stopping jail %s\n", cj.Name)
// 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")
cj.Config.Release = cvers
WriteConfigToDisk(cj, false)
// Get and write new release into config.json
updateVersion(cj)
out, err := executeCommand(fmt.Sprintf("rctl jail:%s", cj.InternalName))
if err == nil && len(out) > 0 {
@ -456,7 +449,7 @@ func StopJail(args []string) {
}
}
}
WriteConfigToDisk(cj, false)
writeConfigToDisk(cj, false)
}
}