This will remove [nzbmatrix.com] from downloaded folder names. Its adapted from the useful clam virus scan script so they can be combined into one if you wished.
#! /bin/sh
BASENAME=`basename "$1"`
echo "Path to download is $1"
echo "Directory is $BASENAME"
echo "Stripped would be ${BASENAME%\[nzbmatrix.com\]}"
if [ "$BASENAME"=*\[nzbmatrix.com\]* ]; then
echo 'Directory name contains [nzbmatrix.com]'
echo "Renaming directory $BASENAME to ${BASENAME%\[nzbmatrix.com\]}"
cd "$1"/..
mv "$BASENAME" "${BASENAME%\[nzbmatrix.com\]}"
else
echo '[nzbmatrix.com] not present in title, all is well!'
fi
#! /bin/sh
BASENAME=`basename "$1"`
echo "Path to download is $1"
echo "Directory is $BASENAME"
echo "Stripped would be ${BASENAME%\[nzbmatrix.com\]}"
if [ "$BASENAME"=*\[nzbmatrix.com\]* ]; then
echo 'Directory name contains [nzbmatrix.com]'
echo "Renaming directory $BASENAME to ${BASENAME%\[nzbmatrix.com\]}"
cd "$1"/..
mv "$BASENAME" "${BASENAME%\[nzbmatrix.com\]}"
else
echo '[nzbmatrix.com] not present in title, all is well!'
fi
FORCLAM="${1%\[nzbmatrix.com\]}"
LOGFILE="$FORCLAM/clamscan.log"
NEWBASE=`basename "$FORCLAM"`
echo "Path to scan for viruses is $FORCLAM"
/usr/bin/clamscan -i -l "$LOGFILE" -r "$FORCLAM"
if [ $? -eq 1 ]; then
cd "$FORCLAM"/..
mv "$NEWBASE" _INFECTED_"$NEWBASE"
fi