You've already forked ddns-updater
done
This commit is contained in:
26
internal/ignore_list.go
Normal file
26
internal/ignore_list.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"net"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
func checkAddress(address, pattern string) bool {
|
||||
pattern = "^" + pattern + "$"
|
||||
re := regexp.MustCompile(pattern)
|
||||
return re.MatchString(address)
|
||||
}
|
||||
|
||||
func IgnoredIpChange(ip net.IP, ignored []string) bool {
|
||||
if len(ignored) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, i := range ignored {
|
||||
if checkAddress(ip.String(), i) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user