pull-plex, fix rm command, change the catted file to be the dirname, and add better output.
This commit is contained in:
@@ -390,22 +390,24 @@ function pull-plex {
|
||||
dest=/sdcard/Movies/
|
||||
fi
|
||||
|
||||
echo "`date` - Copying files from '$plex_dir' to '$dest'."
|
||||
su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'"
|
||||
|
||||
echo -e "\n`date` - Combining videos split into chunks."
|
||||
cd "$dest"
|
||||
ls | while read dir; do
|
||||
echo "Checking '$dir'"
|
||||
echo -e "\n Checking '$dir'"
|
||||
cd "$dir"
|
||||
ls -lh
|
||||
# Unsure why -e and -f don't work here. Spaces in filenames? Globs?
|
||||
if [[ `ls *.chunk0 2>/dev/null` ]]; then
|
||||
final="movie.mkv"
|
||||
echo "Catting files together to make '$final'."
|
||||
final="$dir.mkv"
|
||||
echo -e "\n Catting files together to make '$final'."
|
||||
|
||||
cat *.chunk* > $final
|
||||
ls -lh $final
|
||||
cat *.chunk* > "$final"
|
||||
ls -lh "$final"
|
||||
|
||||
rm -v *.chunk*
|
||||
mv -v *.chunk* ~/TRASH/
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user