Code: Select all
#!/bin/sh
BASENAME=`basename "$1"`
LOGFILE="$1/clamscan.log"
/usr/bin/clamscan -i -l "$LOGFILE" -r "$1"
if [ $? -eq 1 ]; then
cd "$1"/..
mv "$BASENAME" _INFECTED_"$BASENAME"
fiCode: Select all
#!/bin/sh
BASENAME=`basename "$1"`
LOGFILE="$1/clamscan.log"
/usr/bin/clamscan -i -l "$LOGFILE" -r "$1"
if [ $? -eq 1 ]; then
cd "$1"/..
mv "$BASENAME" _INFECTED_"$BASENAME"
fiOf course I tested it, and yes it did detect the virus just fine.shypike wrote: Did it find any viruses yet?
Seriously, it hard to tell if it actually works until it catches a virus.
Code: Select all
#!/bin/sh
BASENAME=`basename "$1"`
LOGFILE="$1/clamscan.log"
/usr/bin/clamscan -i -l "$LOGFILE" -r "$1"
if [ $? -eq 1 ]; then
cd "$1"/..
mv "$BASENAME" _INFECTED_"$BASENAME"
echo "Virus found!"
else
echo "All OK - no virus found."
fi
for the result (with the old output at the bottom of the picture)