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/
|
dest=/sdcard/Movies/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "`date` - Copying files from '$plex_dir' to '$dest'."
|
||||||
su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'"
|
su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'"
|
||||||
|
|
||||||
|
echo -e "\n`date` - Combining videos split into chunks."
|
||||||
cd "$dest"
|
cd "$dest"
|
||||||
ls | while read dir; do
|
ls | while read dir; do
|
||||||
echo "Checking '$dir'"
|
echo -e "\n Checking '$dir'"
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
ls -lh
|
ls -lh
|
||||||
# Unsure why -e and -f don't work here. Spaces in filenames? Globs?
|
# Unsure why -e and -f don't work here. Spaces in filenames? Globs?
|
||||||
if [[ `ls *.chunk0 2>/dev/null` ]]; then
|
if [[ `ls *.chunk0 2>/dev/null` ]]; then
|
||||||
final="movie.mkv"
|
final="$dir.mkv"
|
||||||
echo "Catting files together to make '$final'."
|
echo -e "\n Catting files together to make '$final'."
|
||||||
|
|
||||||
cat *.chunk* > $final
|
cat *.chunk* > "$final"
|
||||||
ls -lh $final
|
ls -lh "$final"
|
||||||
|
|
||||||
rm -v *.chunk*
|
mv -v *.chunk* ~/TRASH/
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user