rogier.de.groot
August 12th, 2008, 12:10 PM
Since I'm not much of a bash-programmer, I need some advise for a pet project. I've got a server machine which runs both samba and apache. It's samba share has a folder full of MP3's in it (ordered with several levels of subdirectories). I know I can use mpg123 to play mp3's from the CLI, so I figure it should be possible to write a bash script that picks an mp3 file from my samba share at random, plays it using mpg123 and then repeats. But I don't know how to pick a random file using bash.
Ideally this little script would also set itself and child processes to run at low privilege so it won't interfere with apache on occassional peaks. Don't know how to do that either though.
I guess doing it in python might be a good alternative too, although I do believe the bash version would use less resources.
Anybody got some good suggestions?
Ideally this little script would also set itself and child processes to run at low privilege so it won't interfere with apache on occassional peaks. Don't know how to do that either though.
I guess doing it in python might be a good alternative too, although I do believe the bash version would use less resources.
Anybody got some good suggestions?