I downloaded AVG for Linux (AVG Free Edition for Linux, tar.gz version) from http://free.avg.com/eu-en/download-free-all-product . I installed it and now "avgscan . " scans my current directory and subdirectories. Good.
I then created a SABnzd post-processing script:
Code: Select all
#!/bin/sh
echo "\n"
avgscan "$1" -r /tmp/avgscan-$$ > /dev/null
RETVAL=$?
cat /tmp/avgscan-$$ | tail -n+8 | grep -B100 -m1 -e "----------" # throw away first 8 lines, then find up to first "----"
cat /tmp/avgscan-$$ | grep "Infections found"
exit $RETVAL
with in the details:Exit(5) Infections found : 2(2) (More)
Code: Select all
/home/sander/Downloads/complete/eicar/eicar/eicar.com Virus identified EICAR_Test
/home/sander/Downloads/complete/eicar/eicar/eicar.com.txt Virus identified EICAR_Test
------------------------------------------------------------------------------
Infections found : 2(2)
HTH
EDIT:
Maybe this is better (only output if there is a virus found):
Code: Select all
#!/bin/sh
echo "\n"
avgscan "$1" -r /tmp/avgscan-$$ > /dev/null
#RETVAL=$?
if [ "$?" -ne "0" ]; then
#cat /tmp/avgscan-$$ | tail -n+8 | head -n -5
cat /tmp/avgscan-$$ | tail -n+8 | grep -B100 -m1 -e "----------" # throw away first 8 lines, then find up to first "----"
cat /tmp/avgscan-$$ | grep "Infections found"
exit 1
fi
exit 0