dsnet/report.go
2020-03-05 23:56:24 +00:00

24 lines
428 B
Go

package dsnet
import (
"golang.zx2c4.com/wireguard/wgctrl"
)
func Report() {
conf := MustLoadDsnetConfig()
wg, err := wgctrl.New()
check(err)
defer wg.Close()
dev, err := wg.Device(conf.InterfaceName)
if err != nil {
ExitFail("Could not retrieve device '%s' (%v)", conf.InterfaceName, err)
}
oldReport := MustLoadDsnetReport()
report := GenerateReport(dev, conf, oldReport)
report.MustSave(conf.ReportFile)
}