Fixed bug where DDNSUpdater doesn't update if we start from a new service with current IP address
This commit is contained in:
parent
bb54b722d9
commit
eb7bb4c4d7
Binary file not shown.
6
main.go
6
main.go
@ -160,6 +160,12 @@ func main() {
|
|||||||
fmt.Println(time.Now(), "Starting with current IP:", lastIP)
|
fmt.Println(time.Now(), "Starting with current IP:", lastIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := updateDDNS(holder.get().UpdateURL); err != nil {
|
||||||
|
fmt.Println("Failed to update DDNS:", err)
|
||||||
|
} else {
|
||||||
|
fmt.Println(time.Now(), "DDNS updated successfully")
|
||||||
|
}
|
||||||
|
|
||||||
ticker := time.NewTicker(time.Duration(cfg.CheckIntervalSecs) * time.Second)
|
ticker := time.NewTicker(time.Duration(cfg.CheckIntervalSecs) * time.Second)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user