[launchd-dev] Launch shell script when volume is mounted

Matt Calthrop matt at calthrop.com
Mon Apr 18 12:32:11 PDT 2011


Hi all.

I'm new to this list, and have a question about a task I'm trying to
accomplish that seems to me pretty straightforward.

I want to run a shell script whenever a volume is mounted – and the
shell script needs to somehow know what the name of the volume is that
has just been mounted.

I know it can be done (HardwareGrowler does it), but I just haven't
found out how yet.

Initially, I thought I could do it using Peter Borg's lingon app
(http://www.peterborgapps.com/lingon/); this *almost* did the job, but
I have checked with the developer, and he told me that although his
app can detect when a volume is mounted, it can't pass the name of the
mounted volume in to the shell script that is run.

He then directed me to this list.

So: any help would be most appreciated!

kind regards,

Matt


More information about the launchd-dev mailing list