Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fa7e0d19f7
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (22 sloc) 0.797 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# MODULE gbanlist_update
#
# This will send a copy of each matched ban to a defined bot
# That bot will then replay it via SQL.
#

satmd_botnet_require sqlite3

if { [isbotnick $satmd_botnet(gbanlist_updater,target)] } {
package require Tcl 8.4
}

bind bot - "satmd_botnet_gban_update" satmd_botnet_gban_update

proc satmd_botnet_gban_update { from keyword text } {
global satmd_botnet
if { ![matchattr $from $satmd_botnet(flag)] } { return 0 }
set banmask [lindex $text 0]
set now [unixtime]
sqlite3-gban eval { UPDATE gban_seen SET seen=$now WHERE banmask=$banmask; }
sqlite3-gban eval { UPDATE gban_seen SET bot=$from WHERE banmask=$banmask; }
}

catch { source $satmd_botnet(basepath)/gbanlist_update.tcl }

# Success
set satmd_botnet(version,gbanlist_update_sqlite3) "0.3.2"
return 1
Something went wrong with that request. Please try again.