daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Nov 21st, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. directory=$1
  4.  
  5. dest=/Volumes/Andre_800G/Serien/ready/
  6. destBin="done"
  7.  
  8. cd $directory
  9. if [ ! -d "$destBin" ]; then
  10.     echo "Creating folder $destBin..."
  11.     mkdir $destBin
  12. fi
  13.  
  14. shopt -s nullglob
  15. for f in *.mkv
  16. do
  17.     echo "Processing file $f..."
  18.     trackID=$(mkvmerge -I "$f" | sed -En 's/Track ID ([0-9]*): audio.*language:eng.*/\1/p')
  19.     mkvmerge -o "$dest/$f" -a $trackID "$f"
  20.     echo "Move the file to the \'$done\' folder."
  21.     mv "$f" $destBin
  22.     echo ""
  23. done
RAW Paste Data
Top