Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bind pub - !test asn_report
- proc asn_report {nick host handle chan text} {
- set ipv6 0
- set ipv4 0
- set asn [lindex $text 0]
- set subnet [lindex $text 1]
- # nel caso in cui scrivano cazzate
- set ipv6 [string match -nocase "*:*" $subnet]
- set ipv4 [string match -nocase "*.*" $subnet]
- putlog "ipv4: $ipv4"
- putlog "ipv6: $ipv6"
- if {[expr {$ipv4 == 0 && $ipv6 == 0} ] } {
- putserv "NOTICE $nick :- \037CIDR6-REPORT\037 - \002$nick\002, esempio per la sintassi !aspath 6939 2001:"
- return 0
- }
- putlog "sono dopo il notice di errore"
- if { [expr {$ipv6 > 0 }] } {
- putserv "PRIVMSG $chan : \002 "
- putserv "PRIVMSG $chan : \002##\002 Request \037AS-PATH\037 of \002AS$asn\002 on prefix \002$subnet\002 via \037CI"
- putserv "PRIVMSG $chan : \002 "
- set data_var [exec w3m https://www.cidr-report.org/cgi-bin/as-report?as=$asn&view=2.0&v=6 2>&1 | grep "$subnet"]
- set l [split $data_var "\r\n"]
- foreach i $l { puthelp "PRIVMSG $chan : $i " }
- putlog "<<$chan>> !$handle! !aspath"
- } else {
- if { [expr {$ipv4 > 0} ] } {
- putserv "PRIVMSG $chan : \002 "
- putserv "PRIVMSG $chan : \002##\002 Request \037AS-PATH\037 of \002AS$asn\002 on prefix \002$subnet\002 via \037CI"
- putserv "PRIVMSG $chan : \002 "
- set data_var [exec w3m https://www.cidr-report.org/cgi-bin/as-report?as=$subnet&view=2.0 2>&1 | grep "$subnet"]
- set l [split $data_var "\r\n"]
- foreach i $l { puthelp "PRIVMSG $chan : $i " }
- putlog "<<$chan>> !$handle! !aspath"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement