i tryed to make a little script.
this will be called in some other procs with
get:ban:mask "$BUZAin"
and $BUZAin will be always nick!ident@host.
Code: Select all
proc get:ban:mask { BUZAin } {
global ipbanhosts BUZAout botnick botname
putlog "get:ban:mask -- eingangsmask -- $BUZAin"
set BUZA [lindex [split $BUZAin "!"] 1]
set ::BUZAout "*!$BUZA"
if {[string match "*.users.quakenet.org*" $BUZAin]} { set BUZA [lindex [split $BUZAin "@"] 1] ; set ::BUZAout "*!*@$BUZA" }
if {[string match "*@*proxad*" $BUZAin]} { set BUZA [lindex [split $BUZAin "@"] 1] ; set ::BUZAout "*!*@$BUZA" }
if {[string match "*@*chello*" $BUZAin]} { set BUZA [lindex [split $BUZAin "@"] 1] ; set ::BUZAout "*!*@$BUZA" }
if {[string match "*@*kabelbw*" $BUZAin]} { set BUZA [lindex [split $BUZAin "@"] 1] ; set ::BUZAout "*!*@$BUZA" }
if {[string match "*@*mediaways*" $BUZAin]} { set BUZA [lindex [split $BUZAin "@"] 1] ; set ::BUZAout "*!*@$BUZA" }
[...........................much other.............]
if {[string match $botnick $BUZAout]} { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - botnick" }
if {[string match $botname $BUZAout]} { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - botname" }
if { "*!" == $BUZAout } { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - *!*@*" }
if { "*!@*" == $BUZAout } { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - *!*@*" }
if { "*!*@*" == $BUZAout } { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - *!*@*" }
if { "*!*@" == $BUZAout } { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - *!*@*" }
if { "!*@*" == $BUZAout } { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - *!*@*" }
if { "*!@" == $BUZAout } { set BUZAout "error!*@*" ; putlog "proc get:ban:mask in: $BUZAin out: $BUZAout - *!*@*" }
putlog "get:ban:mask -- ausgangsmask -- $BUZAout"
return $BUZAout
}
Those putlogs will be removed later, for sure. Just for tests.
I think i should make it smaller but no idea how.
Next point, i need to know how can i set that every nick!ident@134.345.454.43 will be masked with *!*@ip ?