#by wiebe @ QuakeNet
#requires dns.tcl



#help dns pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} help dns" c_dns:help:pub

proc c_dns:help:pub { nick uhost handle chan text } {
  lappend output "Usage: dns <ip>|<host>"
  lappend output "Shows all results from a dns lookup."
  if { [catch {set x [cnotice $nick $output]} error] || !$x } {
    foreach t $output { puthelp "NOTICE $nick :$t" }
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}



#dns pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} dns" c_dns:pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} dns *" c_dns:pub

proc c_dns:pub { nick uhost handle chan text } {
  set mask [lindex [split $text] 2]
  if { [catch {dns:pub $nick $uhost $handle $chan $mask} error] } {
    putlog "ERROR using dns.tcl, perhaps you have not loaded it?"
    error $error
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}

