From: Yoann G. <jj...@us...> - 2005-12-03 13:24:12
|
Update of /cvsroot/ngetsuite/ngetsuite2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9100 Modified Files: ngetsuite.rb Added Files: parrar-sh Log Message: updated --batch, added parrar-sh for autopar2+unrar --- NEW FILE: parrar-sh --- #!/bin/sh for base in "$@" do echo "working on $base" # copy the bigger file as canonical name for i in "$base".part*.rar.*.* "$base".r??.*.* "$base".0??.*.* "$base".vol*.par2.*.* "$base".vol*.PAR2.*.* do canon="${i%.*.*}" [ -f "$i" ] && ( [ -f "$canon" ] || cp "$i" "$canon" ) [ -f "$i" ] && [ $(du -b "$i" |cut -f1) -gt $(du -b "$canon" |cut -f1) ] && cp "$i" "$canon" done # find the par2 file and run it [ -f "$base.vol000+01.par2" ] && parfile="$base.vol000+01.par2" [ -f "$base.par2" ] && parfile="$base.par2" [ -f "$base.PAR2" ] && parfile="$base.PAR2" if [ -z "$parfile" ] then echo 'no par2 file detected..' else par2 r -q "$parfile" && # if successful, delete all non-good-data files rm -f "$base.PAR2" "$base.par2" "$base".vol*.par2* "$base".vol*.PAR2* "$base".r??.* "$base".part*.rar.* "$base".sfv "$base".nzb "$base"*.1 fi # find the first archive file and unrar it, delete archives on success [ -f "$base.001" ] && rarfile="$base.001" [ -f "$base.rar" ] && rarfile="$base.rar" [ -f "$base.part1.rar" ] && rarfile="$base.part1.rar" [ -f "$base.part01.rar" ] && rarfile="$base.part01.rar" [ -f "$base.part001.rar" ] && rarfile="$base.part001.rar" [ -z "$rarfile" ] && { echo 'no rar file detected.. aborting' ; continue ; } rar x "$rarfile" && rm -f "$base".r?? "$base".part*.rar && [ "$rarfile" == "$base.001" ] && rm -f "$base".0?? "$base".0??.*.* done echo ' finished!' Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite2/ngetsuite.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ngetsuite.rb 2 Dec 2005 02:07:43 -0000 1.2 --- ngetsuite.rb 3 Dec 2005 13:24:04 -0000 1.3 *************** *** 46,50 **** [ '--show-next-queueitem', '-b', GetoptLong::NO_ARGUMENT, 'Shows the next available queue for the manager'], [ '--start-manager', '-m', GetoptLong::NO_ARGUMENT, 'Launches the download manager'], ! [ '--batch', '-B', GetoptLong::REQUIRED_ARGUMENT, 'Starts to download a batch here'] ] --- 46,50 ---- [ '--show-next-queueitem', '-b', GetoptLong::NO_ARGUMENT, 'Shows the next available queue for the manager'], [ '--start-manager', '-m', GetoptLong::NO_ARGUMENT, 'Launches the download manager'], ! [ '--batch', '-B', GetoptLong::REQUIRED_ARGUMENT, 'groupid,nrthread,regex', 'Starts to download a batch here'] ] |