- Subject: udev rule matching using ENV
- From: william <kc@xxxxxxxxxxxxxx>
- Date: Tue, 26 Jul 2011 21:18:47 +0200
- In-reply-to: <4E2F1236.8050500@cobradevil.org>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
Dear list
i am trying to create a udev rule which executes a script whenever a usb
stick is removed with a particular uuid
The uuid is changeable and we have a common settings file which exports
the UUID from the usb partition.
What i would like is to import the UUID from the settings file and match
that with the actual ID_FS_UUID with the remove action.
So i created 99-remove-usb.rules with the following contents
IMPORT{program}="/usr/local/bin/usb-stick-uuid.sh"
ACTION=="remove", ENV{ID_FS_UUID}=="ENV{MY_UUID}",
RUN+="/usr/local/bin/usb-removed.sh"
The program usb-stick-uuid.sh now only echo's:
MY_UUID=ff744c66-3671-447c-8fa0-d96fc6f82352
and nothing else.
But it does never match.
When i enter the uuid by hand in the rule it does work:
ACTION=="remove",
ENV{ID_FS_UUID}=="ff744c66-3671-447c-8fa0-d96fc6f82352",
RUN+="/usr/local/bin/usb-removed.sh"
Am i doing something wrong or is it just the way it works? I also could
not find any example on the internet matching two ENV strings.
My system:
ubuntu 10.10
udev version 162
With kind regards
William
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux DVB]
[Video Technology]
[Asterisk]
[Photo]
[DCCP]
[Netdev]
[Xorg]
[Util Linux NG]
[Xfree86]
[Devices]
[Fedora Women]
[ALSA Devel]
[Linux USB]