1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00
This commit is contained in:
Timothy 2018-05-14 11:09:24 +08:00
parent 4fede06128
commit cc51388579
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ func (handler *DNSPodHandler) DomainLoop(domain *godns.Domain, panicChan chan<-
}
// Continue to check the IP of sub-domain
if len(ip) > 0 && !strings.Contains(currentIP, ip) {
if len(ip) > 0 && strings.TrimRight(currentIP, "\n") != strings.TrimRight(ip, "\n") {
log.Printf("%s.%s Start to update record IP...\n", subDomain, domain.DomainName)
handler.UpdateIP(domainID, subDomainID, subDomain, currentIP)

View File

@ -51,7 +51,7 @@ func (handler *HEHandler) DomainLoop(domain *godns.Domain, panicChan chan<- godn
//Compare currentIP with saved IP
savedIP := godns.LoadCurrentIP()
if savedIP != "" && currentIP == savedIP {
if savedIP != "" && strings.TrimRight(currentIP, "\n") == strings.TrimRight(savedIP, "\n") {
log.Printf("Current IP is not changed, no need to update...")
} else {
godns.SaveCurrentIP(currentIP)