Well well well!!
Thanks to advice from blm-ubunet and Keith_Helm on ubuntu forums and ixer on stack exchange I have changed the construction of the 'if' statements to match bits of advice and headless rip is now working thank you.
Udev rule as follows:
Code:
Code:
# ID_CDROM_MEDIA_BD = Bluray
# ID_CDROM_MEDIA_DVD = DVD
# ID_CDROM_MEDIA_CD = CD
ACTION=="change", SUBSYSTEMS=="scsi", KERNEL=="s[rg][0-9]*", ATTRS{vendor}=="TSSTcorp", ENV{ID_CDROM}=="?*", MODE="0660", GROUP="optical", RUN+="/usr/local/bin/DiscTypeTest3.sh"
links to script as follows
Code:
Code:
#!/bin/bash
# ID_CDROM_MEDIA_BD = Bluray
# ID_CDROM_MEDIA_DVD = DVD
# ID_CDROM_MEDIA_CD = CD
MEDIA=
if [ $ID_CDROM_MEDIA_DVD = "1" ]
then
MEDIA=dvd
(
echo "$MEDIA" >> "/var/log/DiscTypeTest.log"
) &
elif [ $ID_CDROM_MEDIA_CD = "1" ]
then
MEDIA=cdrom
(
echo "$MEDIA" >> "/var/log/DiscTypeTest.log"
) &
fi
(set -o posix ; set) > "/var/log/DiscTypeTestVariables.log"
produces the following output in
Code:
/var/log/DiscTypeTest.log
when an audio CD and then a DVD is inserted
Code:
cdrom
cdrom
dvd
dvd
I figure next step for me is to add in the paths to the ripping scripts where the echo commands currently sit. Buy a blu-ray drive and reinsert the blu-ray loop and we are there!
Hope this helps someone
James