Skip to content

Instantly share code, notes, and snippets.

@EldonMcGuinness
Last active September 20, 2016 20:02
Show Gist options
  • Save EldonMcGuinness/11174d7eae5b2b680dd8190e6b5f3f83 to your computer and use it in GitHub Desktop.
Save EldonMcGuinness/11174d7eae5b2b680dd8190e6b5f3f83 to your computer and use it in GitHub Desktop.
#!/bin/sh
for i in *.cb*; do
echo $i
mkdir -p temp rebuilt
case "$i" in
*.cbr)
unrar e -o+ "$i" temp
;;
*.cbz)
unzip -o "$i" -d temp
;;
esac
zip -r -j "rebuilt/${i%%.*}.cbz" temp/*
rm -fR temp
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment