mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
fix issue #20
This commit is contained in:
parent
4fede06128
commit
cc51388579
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user