WIP on rollback, started "gocage console", default values for jail properties to stay compatible with iocage

This commit is contained in:
yo
2022-04-05 20:58:11 +02:00
parent 4aa1c81fea
commit 0053fd6c8b
4 changed files with 255 additions and 3 deletions

View File

@@ -18,8 +18,9 @@ import (
*******************************************************************************/
func ListJailsProps(args []string) {
var conf Jail
var jailconf JailConfig
var result []string
// Mandatory constructor to init default values
jailconf := NewJailConfig()
conf.Config = jailconf
@@ -213,7 +214,8 @@ func getJailConfig(jailConfigPath string) (JailConfig, error) {
content, err := ioutil.ReadFile(jailConfigPath)
if err != nil { log.Fatalln(fmt.Sprintf("Unable to read %s, check path and/or rights", jailConfigPath)) }
var jc JailConfig
// Mandatory constructor to init default values
jc := NewJailConfig()
err = json.Unmarshal([]byte(content), &jc)
if err != nil { log.Fatalln(fmt.Sprintf("Error occured during unmarshaling %s: %s", jailConfigPath, err.Error())) }