This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

eggdrop logviewer

Old posts that have not been replied to for several years.
Locked
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

eggdrop logviewer

Post by Pitchat »

Hi

I`d like to know if there is a way to make a kind of "logviewer" for eggdrop so i can list files in the logs directory , and open them without the obligation to download it from the eggdrop ( i try to use eggpad.tcl but it`s not made for what i want to do ) i dont want to edit the files but juste open it so i can view it then close it again

any suggestion welcome !
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

bind dcc n readlog dcc:readlog
proc dcc:readlog { h i a } {
  if {[llength [split $a]] != 1} { 
    putdcc $i "usage: .$::lastbind <logfile>" 
    putdcc $i [join [glob -nocomplain -directory logs *.log]]
    return
  }
  if {![file exists [set f [lindex [split $a] 0]]] || ![file readable $f]} { 
    putdcc $i "Error..."
    return 
  }
  set d [split [read [set fp [open $f r]]] \n] ; close $fp
  putdcc $i "LOG START"
  foreach l $d { putdcc $i $l }
  putdcc $i "LOG END (read [llength $d] lines)"
  return
}
something like this should work. i dont know how big the logfile has to be before using [read] becomes a bad idea, but feel free to bitch about it if it breaks your bot :)

also note that you can read any file that is readable by the eggdrop's uid/gid
photon?
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

i`ll be an asshole if i go and bitch about the help you gave me ;)

you gave me a pretty good base , if not the entire solution, to the problem i have.

the logfiles size should not be a problem since it is a small channel with moderate traffic

thanks again !
Locked