rendered paste bodybind time -|- "45 14 * * *" update-notification
proc update-notification { } {
global scriptversion adminchannel scriptdir
set oldversion "[string map {"." "-"} $scriptversion] 00:00:00"
set urlcontent [http::data [http::geturl http://sloth.digitalshells.com/~ftw/tempfilters.tcl]]
foreach line [split $urlcontent "\n"] {
if {[string match -nocase "*Version:*" $line]} {
set newversion "[string map {"." "-"} [lindex $line 2]] 00:00:00"
}
}
if {$newversion <= $oldversion} {
putlog "no new version found ..."
return 0
}
putserv "PRIVMSG $adminchannel :Hey - new version found: [clock format $newversion -format "%Y-%m-%d"]"
set fid [open "$scriptdir/tempfilters.tcl" w]
puts $fid $urlcontent
close $fid
rehash
putserv "PRIVMSG $adminchannel :okiiiiiiii - script updated"
}