Advertisement
tari

Untitled

Jan 28th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. filesexist() {
  4.   ls $1 | grep .$2\$ | wc -l
  5. }
  6.  
  7. anyexist() {
  8.   [ `filesexist $1 $2` -gt 0 ]
  9. }
  10.  
  11. replaygain() {
  12.   if anyexist "$1" mp3
  13.   then
  14.     mp3gain -p -a -k -s i -o "$1"/*.mp3
  15.   fi
  16.  
  17.   if anyexist "$1" flac
  18.   then
  19.     metaflac --add-replay-gain "$1"/*.flac
  20.   fi
  21. }
  22.  
  23. find -type d -newermt '-1 month' -exec replaygain {} \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement