First post, so hello! Let me start with what I'm talking about programming. I understand very simple stuff, but when it comes to checking exit codes or what is a suitable term, I'm at a loss. Apparently, my search engine is really weak in this area, I think this is a matter of terminology.
Thank you in advance for reading this / answering my question!
Description : I found a script that converts / repackages .cbr files to .cbz. These files are basically your average rar and zip files, however renamed to another extension, as they are used for (comic) book applications like comicrack , qcomicbook , and what not. Surprisingly, there are no cbr β cbz converters. The benefits of .cbz also avoid the proprietary rar file format that you can store metadata from Comic Vine with e. g comictagger .
Problem . Sometimes repackaging files does not end well and, hopefully, will be mitigated by integrity checking and another. I changed the script a bit to use p7zip , since it can like pack / unpack 7z , zip files and some others , i.e. e great for options. p7zip can test the archive:
7z t comicfile.cbz tmpworkingdir
I assume it is a matter of using if and else here (?) To check the integrity, and then give it one more step if there are any errors.
Question / tl; dr: What would be the βbestβ / adequate approach for adding file integrity checking to the script below?
#!/bin/bash
Oh mankind, without publishing more than two links up to 10 reputation, and I linked the shit from OP .. [edit] ah .. mh-mmm .. there we go ..
[edit 2] I removed unrar as a dependency and used p7zip instead, since it can extract rar files.