dyndns: don’t crashloop when config does not exist

related to #46
This commit is contained in:
Michael Stapelberg 2020-05-28 09:46:37 +02:00
parent 7950291db6
commit f1e4ee0662

View File

@ -27,6 +27,7 @@ import (
"os"
"time"
"github.com/gokrazy/gokrazy"
"github.com/libdns/cloudflare"
"github.com/libdns/libdns"
"github.com/rtr7/router7/internal/dyndns"
@ -126,6 +127,9 @@ func main() {
}
b, err := ioutil.ReadFile(*configFile)
if err != nil {
if os.IsNotExist(err) {
gokrazy.DontStartOnBoot()
}
log.Fatal(err)
}
if err := json.Unmarshal(b, &config); err != nil {