1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-DecodeAll synced 2024-05-02 20:54:06 +02:00

Replacing old uncut files with new cuttable otrkeys

This commit is contained in:
Jonny007-MKD 2015-03-29 20:09:35 +02:00
parent 22bad54afe
commit bbfdfce5bf

View file

@ -440,6 +440,25 @@ function funcProcessFiles {
if (( success == 1 )); then # Cutting did not fail
status=3;
alrMoved=0; # Our new file is in tempDir
else # Cutting did fail
local sizeEnc
local sizeDec
sizeEnc=`stat -L -c%s "$pathAbsEncoded"`
sizeDec=`stat -L -c%s "$pathTmpAbsDecoded"`
if [ $(($sizeEnc-$sizeDec)) -ne 522 ]; then # If decoded file is different to encoded file
funcLog 5 "Cutting failed. But the encoded file ($sizeEnc) is not the source of the decoded file ($sizeDec)."
funcLog 5 "Searching cutlists for encoded file"
funcLog 5 "$cmdCut -find-cl 522 \"$pathAbsEncoded\""
$cmdCut -find-cl 522 "$pathAbsEncoded"
if [ $? -eq 0 ]; then # The (new) encoded file can be cut
funcLog 3 "The new otrkey file can be cut. We will try it."
## What shall we do now?
funcRemoveFile "$pathTmpAbsDecoded"
# Next time the file will be decoded and cut. This is not the best way...
else
funcLog 5 "No cutlist found"
fi
fi
fi
fi