- # Move the largest created MKV file into place
- # There might be multiple ones, so just grab the largest one
- largest_mkv_file=`/bin/ls -1S "$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 [ $makemkv_copy_largest_title_only -eq 1 ]; then
+ # Move the largest created MKV file to destination
+ # There might be multiple ones, so just grab the largest one
+ largest_mkv_file=`/bin/ls -1S "$dstdir"/*.mkv | head -1`
+ echo -e "\n Moving largest mkv file $largest_mkv_file -> $dstmkv\n" | tee -a "$ddrescuelog"
+ mv "$largest_mkv_file" "$dstmkv"
+ else
+ # Move all of the created MKV files to destination
+ 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"
+ fi