I have SAB running on an Xtreamer eTrayz, and use an Xtreamer Pro to play my media.
The Xtreamer Pro will not play .img files unless they are renamed .iso
I want to create a script for my movie catagories that will check if it's an .img that's been downloaded, and if so, rename it to .iso
Obviously it would have to check in any sub directories.
This is what I have managed to cobble together so far. My question is, will it work? and is there a simpler/better way to do this?
Code: Select all
#!/bin/bash
cd "$1"
for name in `ls -R *.img`
do
name1=`echo $name | sed -e 's/^\(.*\)\.img$/\1\.iso/g'`
mv $name $name1
done