Set property K for int type + write config to disk
This commit is contained in:
10
cmd/root.go
10
cmd/root.go
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
gVersion = "0.022b"
|
||||
gVersion = "0.023"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -188,12 +188,16 @@ func cleanAfterRun() {
|
||||
for _, j := range gJails {
|
||||
if j.ConfigUpdated {
|
||||
// TODO : Marshall to disk
|
||||
fmt.Printf("Config for jail %s will be updated\n", j.Name)
|
||||
//fmt.Printf("Config for jail %s will be updated\n", j.Name)
|
||||
marshaled, err := json.MarshalIndent(j.Config, "", " ")
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR marshaling config: %s\n", err.Error())
|
||||
}
|
||||
fmt.Printf(string(marshaled))
|
||||
//fmt.Printf(string(marshaled))
|
||||
if os.WriteFile(j.ConfigPath, []byte(marshaled), 0644); err != nil {
|
||||
fmt.Printf("Error writing config file %s: %v\n", j.ConfigPath, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user