1

Ok so I'm trying to run a headless makemkv server and while I have my script working perfectly, I'm missing something for the udev rules. Below is what I have for rules:

SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh sr0"
SUBSYSTEM=="block", KERNEL=="sr1", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh sr1"
SUBSYSTEM=="block", KERNEL=="sr2", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh sr2"
SUBSYSTEM=="block", KERNEL=="sr3", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh sr3"
SUBSYSTEM=="block", KERNEL=="sr4", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh sr4"

How should I call the script and TELL the script which DVD drive had the disc inserted?

Thanks in advance!

0

You can use string globbing to match multiple values and place holders inside assignment:

SUBSYSTEM=="block", KERNEL=="sr?*", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh %k"

For more info see “Writing udev rules”.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.