finish dsnet init -- write to sys file
This commit is contained in:
parent
2c3bb65612
commit
55ee25d943
8
init.go
8
init.go
@ -6,6 +6,7 @@ import (
|
||||
"math/rand"
|
||||
"net"
|
||||
"time"
|
||||
"io/ioutil"
|
||||
//"github.com/mikioh/ipaddr"
|
||||
)
|
||||
|
||||
@ -23,12 +24,11 @@ func Init() {
|
||||
ReportFile: DEFAULT_REPORT_FILE,
|
||||
}
|
||||
|
||||
//fmt.Println(conf.Network.String())
|
||||
//fmt.Printf("%-+v/n",conf)
|
||||
|
||||
_json, _ := json.MarshalIndent(conf, "", " ")
|
||||
err := ioutil.WriteFile(CONFIG_FILE, _json, 0600)
|
||||
check(err)
|
||||
|
||||
fmt.Println(string(_json))
|
||||
fmt.Printf("Config written to %s. Please edit.", CONFIG_FILE)
|
||||
}
|
||||
|
||||
// get a random /22 subnet on 10.0.0.0 (1023 hosts) (or /24?)
|
||||
|
Loading…
Reference in New Issue
Block a user