r00t-err0r

tcl-lusers-to-html

Aug 24th, 2012
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.20 KB | None | 0 0
  1. bind time - "*" save:lusers
  2. bind raw - "250" rawLusers250
  3. bind raw - "251" rawLusers251
  4. bind raw - "255" rawLusers255
  5. bind raw - "265" rawLusers265
  6. bind raw - "266" rawLusers266
  7.  
  8. set lusersfile "/var/www/portal/lusers.html"
  9.  
  10. proc rawLusers250 {from cmd text} {
  11. regexp {H.*} $text ::lusers250
  12. }
  13.  
  14. proc rawLusers251 {from cmd text} {
  15. regexp {T.*} $text ::lusers251
  16. }
  17.  
  18. proc rawLusers255 {from cmd text} {
  19. regexp {I.*} $text ::lusers255
  20. }
  21.  
  22. proc rawLusers265 {from cmd text} {
  23. regexp {C.*} $text ::lusers265
  24. }
  25.  
  26. proc rawLusers266 {from cmd text} {
  27. global ::lusers250 ::lusers251 ::lusers255 ::lusers265 lusersfile
  28.   set fileId [open $::lusersfile w]
  29.   if {[info exists ::lusers250]} {
  30.     puts $fileId "$::lusers250 <br>"
  31.     unset ::lusers250
  32.   }
  33.   if {[info exists ::lusers251]} {
  34.     puts $fileId "$::lusers251 <br>"
  35.     unset ::lusers251
  36.   }
  37.   if {[info exists ::lusers255]} {
  38.     puts $fileId "$::lusers255 <br>"
  39.     unset ::lusers255
  40.   }
  41.   if {[info exists ::lusers265]} {
  42.     puts $fileId "$::lusers265 <br>"
  43.     unset ::lusers265
  44.   }
  45.   regexp {C.*} $text ::lusers266
  46.   puts $fileId $::lusers266
  47.   close $fileId
  48. }
  49. proc save:lusers {min hour day mon year} {
  50. putserv "LUSERS"
  51. }
Advertisement
Add Comment
Please, Sign In to add comment