First of all, many thanks for SABnzbd, it brings newsgroup to the top !
I have two scripts and want to run the two script in the default folder
ClamAV antivirus scan:
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 détecté!"
else
echo "Pas de virus détecté."
fi
Code: Select all
#!/bin/bash
BDMV_FOLD=`find "$1" -name "BDMV" -print0`
if [[ $BDMV_FOLD == *BDMV* ]]; then
# cd to the ./BDMV/STREAM folder
cd "$1"/BDMV/STREAM/
# Find the biggest .M2TS file, usually the movie
BIGST_M2TS=`find . -type f | xargs ls -1S | head -n 1 | rev | cut -c 6- | rev`
# MkvMerge the file
mkvmerge -o "$BIGST_M2TS".mkv --compression -1:none "$BIGST_M2TS".m2ts
# Change MKV permission to -rw-r--r--
chmod 644 "$BIGST_M2TS".mkv
echo "Blu-Ray: MKV created!"
else
echo "BDMV2MKV: no processing"
fi
Code: Select all
#!/bin/bash
cd /home/toto/.sabnzb-script/
./ClamAV
./BDMV2Mkv
The ClamAV script when used alone return(log file created fine):ERROR: Problem with internal logger.
ERROR: Can't open /clamscan.log in append mode (check permissions!).
Pas de virus détecté.
find: `': No such file or directory
BDMV2MKV: no processing
The BDMV To MKV script alone:----------- SCAN SUMMARY -----------
Known viruses: 3149659
Engine version: 0.97.8
Scanned directories: 1
Scanned files: 2
Infected files: 0
Data scanned: 0.00 MB
Data read: 95.37 MB (ratio 0.00:1)
Time: 5.836 sec (0 m 5 s)
Pas de virus détecté.
Systeme is Slackware 14 - 64b Multilib, SABnzbd Version: 0.7.14:BDMV2MKV: no processing
Note that i'm a complete noob in bash script, any help appreciated.toto 4160 0.6 2.7 2651292 221372 ? Sl Aug29 39:27 /usr/bin/python /usr/share/sabnzb/SABnzbd.py -d --browser 0
Regards.