From mboxrd@z Thu Jan 1 00:00:00 1970 From: william Date: Tue, 26 Jul 2011 19:15:02 +0000 Subject: udev rule matching using ENV Message-Id: <4E2F1236.8050500@cobradevil.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Dear list i am trying to create a udev rule which executes a script whenever a usb=20 stick is removed with a particular uuid The uuid is changeable and we have a common settings file which exports=20 the UUID from the usb partition. What i would like is to import the UUID from the settings file and match=20 that with the actual ID_FS_UUID with the remove action. So i created 99-remove-usb.rules with the following contents IMPORT{program}=3D"/usr/local/bin/usb-stick-uuid.sh" ACTION=3D"remove", ENV{ID_FS_UUID}=3D"ENV{MY_UUID}",=20 RUN+=3D"/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=3D"remove",=20 ENV{ID_FS_UUID}=3D"ff744c66-3671-447c-8fa0-d96fc6f82352",=20 RUN+=3D"/usr/local/bin/usb-removed.sh" Am i doing something wrong or is it just the way it works? I also could=20 not find any example on the internet matching two ENV strings. My system: ubuntu 10.10 udev version 162