Bash DVD burn
I wrote a little shell script (that doesn't work 100%). I have 2 dvd burners I'm trying to make it so that if there's no disk in the first one it looks to the second device. It runs if there is a disk in the first drive. Here's my (bad) code:
#!/bin/bash if [ dev/hdc ] ; then growisofs -Z /dev/hdc=/$1 -dvd-compat -speed=16 && eject -v /dev/hdc else growisofs -Z /dev/hdd=/$1 -dvd-compat -speed=16 && eject -v /dev/hdd fi any help is GREATLY appreciated !! Thank you |
You want to use the dvd+rw-mediainfo command. A 251 return code indicates that no disk is loaded. For example:
Code:
/usr/bin/dvd+rw-mediainfo /dev/hdc &>/dev/null |
All times are GMT -5. The time now is 03:46 PM. |