Compare commits

...

2 Commits

Author SHA1 Message Date
Jay e525ac65fe remove lock, change run one time 2018-09-26 19:42:38 +08:00
Jay 4d63b93edb add nic check 2018-09-10 10:44:23 +08:00
1 changed files with 4 additions and 13 deletions

17
main.go
View File

@ -7,7 +7,6 @@ import (
"log"
"net/http"
"regexp"
"time"
"git.trj.tw/golang/go-aws-dns/modules"
@ -42,13 +41,13 @@ func main() {
newR53()
config = setting.LoadConfig(confpath)
fmt.Println(config)
ip = getMyIP()
if ok, err := checkIP(ip); err != nil || !ok {
println("ip check fail")
checkErr(err)
}
println(ip)
mainLoc := make(chan bool)
var tmp []string
for _, it := range config.Domains {
@ -80,18 +79,10 @@ func main() {
fmt.Println(domains[0])
go func() {
for {
println("run loop")
for _, it := range domains {
it.updateRecord()
}
for _, it := range domains {
it.updateRecord()
}
time.Sleep(time.Minute * 5)
}
}()
<-mainLoc
}
func newR53() {