Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Jay | e525ac65fe | |
Jay | 4d63b93edb |
17
main.go
17
main.go
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue