modified cdburn script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The menu works more than once and it has a few notes too.  Haven't been 
yet able to implement logic for off menu responses though yet.

Begin script.
#!/bin/sh
# General purpose CD burner script using crecord and mkisofs
notes() {
echo "1) recursive copying copies all of typed directory and everything"
echo "below that typed directory into an iso image you have been warned."
echo "2) before choosing 2 on menu put disk in burner."
echo "works better that way."
echo "3) tab key works in script same as at bash prompt."
echo "4) enter anything but (1, 2, n, or x) on menu gets immediate bash prompt."
echo "hit enter to return to menu->"
read
CHOICE=""
}

make_iso1() {
echo
echo -n "Enter name of top directory for recursive copying: "
read -e INPUT
echo -n "Enter name of ISO file image: "
read -e ISOFILE
echo -n "Enter volume label: "
read -e VOLID
mkisofs -v -r -J -V $VOLID -o $ISOFILE $INPUT
echo -n \a
echo "hit enter to return to menu->"
read
CHOICE=""
}

write_data1() {
echo -n "Enter name of ISO file: "
read -e ISOFILE
cdrecord -v dev=0,1,0 speed=2 -eject -sao fs=8m $ISOFILE
echo -n \a
echo "hit enter to return to menu->"
read
CHOICE=""
}
bail() {
     echo ""
         echo "Exitting CD burner script!"
exit 0
}
# Main portion
CHOICE=""
while [ "$CHOICE" = "" ] ; do
     clear
     echo "CD Burner Main Menu"
     echo ""
     echo "1 - Build ISO image for single session CD"
     echo "2 - Burn a single session data CD"
echo "n - read notes"
     echo "X - Exit"
     echo ""
     echo -n "Enter choice: "
     read CHOICE
     case "$CHOICE" in
     1)
         make_iso1
     ;;
     2)
         write_data1
     ;;
n)
notes
;;
     x)
bail
     ;;
     esac
done

End script.






[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux