diff --git a/knockr.go b/knockr.go index 0f99a9f..48450e5 100644 --- a/knockr.go +++ b/knockr.go @@ -130,6 +130,7 @@ func gateway_handler(c net.Conn) { func add_to_whitelist(addr string) { // Add the specified address to the whitelist if ! is_whitelisted(addr) { + fmt.Println("[OK ] Add ", addr, " to whitelist") update_whitelist_time(addr) } } @@ -159,7 +160,10 @@ func is_whitelisted(addr string) bool { func add_to_blacklist(addr string) { // Add specified address to blacklist - blacklist = append(blacklist, addr) + if ! is_blacklisted(addr) { + fmt.Println("[OK ] Add ", addr, " to blacklist") + blacklist = append(blacklist, addr) + } } func is_blacklisted(addr string) bool {