I made a slightly improved version of the script. This one requires the proprietary "unrar" binary, like the older one, but it should not put cbr files inside cbz. Also, it takes one file at a time; you can use a simple for loop yourself!
Code:
for a in *.cbr;do cbr2cbz "$a";done
Code:
#bin/bash
cbr=$1
start_directory=`pwd`
cbz=`basename "$cbr" .cbr`.cbz
tempdir=`mktemp -d`
cd "$tempdir"
unrar e -inul "$start_directory/$cbr"
zip -q "$start_directory/$cbz" *
rm -rf "$tempdir"
Also, it doesn't change file names (except replacing .cbr with .cbz of course), and uses a generated temporary folder in /tmp/ instead of a fixed name. And it doesn't copy around the files like the previous one; unrar will extract to the current directory, there's no need for any copying.
Bookmarks