ohhdemgirls

Unrar.sh

Nov 14th, 2013
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. # put this file and xbiso.pl in the directory with your xbox game folders
  2. # warning, this code does not handle spaces in file or directory names
  3.  
  4. # No CRC, no clean up, no log
  5.  
  6. startdir=`pwd`
  7.  
  8. for f in `find . -type f`
  9.   do
  10.  
  11.     foundpath=`dirname $f`
  12.     foundname=`basename $f`
  13.  
  14.     # will find *.001 or *.rar, including *part01.rar or *part001.rar
  15.     # but never "part", proceeded by a number greater then 01 or 001, then ending in ".rar"
  16.     if [[ $foundname = *.rar || $foundname = *.001 ]]; then
  17.       if [[ $foundname = *part01.rar ||
  18.       $foundname = *part001.rar ||
  19.       $foundname = *.001 ||
  20.       $foundname = !(*part[0-9][0-9]|*part[0-9][0-9][0-9]).rar ]]; then
  21.  
  22.         cd $startdir/$foundpath
  23.         currentdir=${PWD##*/}
  24.         echo "FOUND!  $currentdir"
  25.        
  26.         echo "Unpacking rar..."
  27.         unrar x -inul $foundname
  28.                
  29.         # rename iso, will be the same name as the parent dir
  30.         echo "Renaming iso..."
  31.         mv $isofile $currentdir.iso
  32.         echo "----------------"
  33.  
  34.       fi
  35.     fi
  36.  
  37. done
Advertisement
Add Comment
Please, Sign In to add comment