I'm trying to make it so that when I insert a dvd into the cdrom It exports it into an iso using dd. Here's the script for exporting to an iso
#!/bin/bash
timestamp=$(date +"%Y%m%d_%H%M%S")
filename="/home/tom/sambashare/${timestamp}.iso"
dd if=/dev/sr0 of=${filename} status=progress
md5sum ${filename} > ${filename}.md5
The script works just fine when launched from the terminal. Hovewer when I try to launch it from udev (using an udev rule) it will create a file and add some kind of data to it till about 139mb where it stops and gets stuck. An interesting thing is that the computer doesn't make any noises like it does when it's reading the dvd when launched from terminal
Here is the udev rule:
ACTION=="change", KERNEL=="sr0", SUBSYSTEM=="block", ENV{ID_CDROM_MEDIA}=="1", RUN+="/home/tom/mybashscript.sh"
I tried adding a sudo into the udev rule which didn't work as well. Using cat instead of dd shows the same behaviour.
