Sex, 2008-12-05 às 10:14 -0500, Reid Thompson escreveu:
> On Fri, 2008-12-05 at 12:55 +0000, José Carlos Martins wrote:
> 
> > Thank you for your kind help and patience.
> > My clamd.conf points to /var/lib/clamav/clamd.socket and i changed it in
> > the ruby program.
> > Yes the socket exist.
> > I have ruby 1.8.7 and zenity 2.24.0 installed.
> 
> First problem is here.
> /home/jose/rubyclamav.rb is failing immediately
> 
> what does
>   which ruby
> return?
> 
> if it does not return /usr/bin/ruby, then change the first line of the
> script from
>   #!/usr/bin/ruby
> to
>   #!/path/to/your/ruby
> 
> > 
> > [EMAIL PROTECTED] ~]$ cat teste3 | /home/jose/rubyclamav.rb
> > /home/jose/rubyclamav.rb: line 4: require: command not found
> > /home/jose/rubyclamav.rb: line 5: syntax error near unexpected token `('
> > /home/jose/rubyclamav.rb: line 5: `fp =
> > File.open("/var/log/rubyclamav/rubyoutclam_#{Process.pid}.log",'
> > [EMAIL PROTECTED] ~]$ echo $?
> 
> 
> what does
>    file /home/jose/rubyclamav.rb
> return?
> 
> what does
>    cat /home/jose/rubyclamav.rb
> display?

Hello

This is what the commands returned:

[EMAIL PROTECTED] ~]$ which ruby
/usr/bin/ruby
[EMAIL PROTECTED] ~]$ file /home/jose/rubyclamav.rb
/home/jose/rubyclamav.rb: ASCII text
[EMAIL PROTECTED] ~]$ cat /home/jose/rubyclamav.rb

#!/usr/bin/ruby
#
require 'socket'
fp = File.open("/var/log/rubyclamav/rubyoutclam_#{Process.pid}.log",
"a")
START_TIME=Time.now
sendSock = UNIXSocket.open('/var/lib/clamav/clamd.socket')
#sendSock = UNIXSocket.open('/var/run/clamav/clamd.ctl')
sendSock.puts("STREAM")
retStr = sendSock.gets
tag, val = retStr.split
sendSock1 =  TCPSocket.open('localhost',"#{val}")
#res = $stdin.read
sendSock1.write($stdin.read)
sendSock1.close
retStr = sendSock.gets
pt = Time.now - START_TIME
#puts "#{retStr}"
#fp.write("#{res}\n")
fp.write("#{retStr}\n")
fp.write("ProcessTime = #{pt}\n")
fp.close
if retStr.match("FOUND") then
        system("zenity --warning --title=\"Evolution: Virus detected\"
--text=\"#{retStr}\" &")
    exit 1
else
    exit 0
end

[EMAIL PROTECTED] ~]$ 

This is a copy/paste from the cli, i am starting to think that copying
instead of typing might be a problem, at least i've seen that in some
forum....

Thank you
José

_______________________________________________
Evolution-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-list

Reply via email to