Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Again, looking to use all native functions.. sox is installed so I plan on using the play command.. where I need help is the mount detection scripting.
I really don't know where to start there, so I can't tell you what I've tried wrt that.
Ok. Can you explain where you're stuck or what exactly you've done? Are you mounting any external device and want a script to detect that device and if that device contains any music files, then play it?
Without complete scenario, it will not be easy to suggest anything, and all it will be just a guess work. Hope this makes some sense now.
What I want to do is something similar to the windows world, where when a device is connected or disconnected a sound is played, one sound for device connections, one for disconnections. The sound files (.wav) would be present on the host filesystem, not the external drives. I'd like this notification to play regardless of the type of drive mounted, or where it was mounted from.
I know how to play the sound files using "play", where I'm stuck is where to begin with detecting drives being mounted. I'd like the script to be independent of any actions I'm taking.. so iow I'm not looking for something that will both mount a drive & play a file, I'm looking for distinct logic that will detect the mounts and unmounts and play the sound.. hope that's better.
---------- Post added 04-04-13 at 02:29 PM ----------
And sorry but I haven't done anything to give you an example thus far, I really don't even know where to start.
Thanks for taking the time to help me out, that looks like a good starting point and i think i would easily be able to write a script based off you guidance in this regard; however my concern is this:
The logic you provided as example depends on testing a condition on the mount point.. so I would need to constantly test the condition and thus it would constantly alert one way or another.. is there a better way to do it such that i'm detecting a change in state on the mount point?
Sorry, perhaps I'm missing something.. but how else would you be able to tell when the change happens in real time? say I've got other users on my system who are logged in and mount drives.. I want to know when that happens and if something is being mounted or unmounted.
I believe the UDev rule will accommodate this request and I have no experience in that arena.
And since I have no experience in that area, I'd be poorly guessing at what that process does
to make it work.