fatal_and_exit "-E- Unhandled makemkv error"
fi
- # Move the created MKV file into place
- dstfile=${dstmkv%.[^.]*}
- typeset -i num=0
- for i in `/bin/ls -1 "$dstdir"/*.mkv`; do
- echo -e "\n Moving $i -> $dstfile.$num.mkv" | tee -a "$ddrescuelog"
- mv "$i" "$dstfile.$num.mkv"
- ((num = num + 1 ))
- done
+ # Move the largest created MKV file into place
+ # There might be multiple ones, so just grab the largest one
+ largest_mkv_file=`/bin/ls -rS "$dstdir"/*.mkv | head -1`
+ echo -e "\n Moving largest mkv file $largest_mkv_file -> $dstmkv\n" | tee -a "$ddrescuelog"
+ mv "$largest_mkv_file" "$dstmkv"
+
+ # Move all of the created MKV file into place
+ #echo "\n" | tee -a "$ddrescuelog"
+ #dstfile=${dstmkv%.[^.]*}
+ #typeset -i num=0
+ #for i in `/bin/ls -1 "$dstdir"/*.mkv`; do
+ #echo -e " Moving $i -> $dstfile.$num.mkv" | tee -a "$ddrescuelog"
+ #mv "$i" "$dstfile.$num.mkv"
+ #((num = num + 1 ))
+ #done
+ #echo "\n" | tee -a "$ddrescuelog"
+
if [ $? != 0 ]; then
fatal_and_exit "-E- Unhandled mv error"
fi