#!/bin/sh
# Check the path of dvd device on the running system before starting this script.
dev_path=/dev/sr0
sudo umount $dev_path -l
isopath=~/img.iso
if [ -f $isopath ]; then
echo "File $isopath already existed, exit"
exit 0
fi
sudo dd if=$dev_path of=$isopath