Skip to content

Commit

Permalink
Properly check if exclhost exist before iterating over it. Version 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratler committed May 14, 2011
1 parent 6b97081 commit 8052ae9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ripecheck.tcl
@@ -1,5 +1,5 @@
#
# ripecheck.tcl Version: 3.6 Author: Stefan Wold <ratler@stderr.eu>
# ripecheck.tcl Version: 3.6.1 Author: Stefan Wold <ratler@stderr.eu>
###
# Info:
# This script check unresolved ip addresses against a RIPE database
Expand Down Expand Up @@ -162,7 +162,7 @@ bind msg -|- !ripehelp ::ripecheck::msgRipeHelp

namespace eval ::ripecheck {
# Global variables
variable version "3.6"
variable version "3.6.1"

variable ipinfodb "http://api.ipinfodb.com/v2/ip_query.php?"
variable geotool "http://geotool.stderr.eu/api"
Expand Down Expand Up @@ -261,11 +261,13 @@ namespace eval ::ripecheck {
set iphost [string tolower $iphost]

# Exclude following hostregexps from being scanned
foreach hostRegexp $::ripecheck::config(exclhost) {
::ripecheck::debug "Testing exclude host regexp '$hostRegexp' for host '$iphost'"
if {[regexp "$hostRegexp" $iphost]} {
::ripecheck::debug "Exclude host regexp '$hostRegexp' matched for host '$iphost'. No further action taken. "
return 1
if {[info exists ::ripecheck::config(exclhost)]} {
foreach hostRegexp $::ripecheck::config(exclhost) {
::ripecheck::debug "Testing exclude host regexp '$hostRegexp' for host '$iphost'"
if {[regexp "$hostRegexp" $iphost]} {
::ripecheck::debug "Exclude host regexp '$hostRegexp' matched for host '$iphost'. No further action taken. "
return 1
}
}
}

Expand Down

0 comments on commit 8052ae9

Please sign in to comment.