diff --git a/bashrc.sh b/bashrc.sh index 259263c..0a0136b 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -386,6 +386,24 @@ function pull-plex { fi su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'" + + cd "$dest" + ls | while read dir; do + echo "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'." + + cat *.chunk* > $final + ls -lh $final + + rm -v *.chunk* + fi + cd .. + done } alias get-plex="pull-plex"