#! /bin/bash ############################################################################### # Settings for menu choices... ############################################################################### INFOCD=1 WIPECD=1 LSTIMG=1 CHANGE=1 DELETE=1 TESTCD=1 CONFIG=1 HOTCNF=":" QUITSEP="---------------------" QUITDSC=": Quit this program." #------------------------------------------------------------------------------ # NOTES: Some of the options are automatic, the rest are enabled/disabled here. #------------------------------------------------------------------------------ # ?????? HELP appears automatically if the help file exists and is readable. # INFOCD determines whether users can get information about a CD in drive. # WIPECD determines whether users can erase a re-writable disk from menu. # ?????? READ appears if there are any defined read drives. # To eliminate READ, undefine CDRx or NAMx for ALL x in 1-9 and a-z. # LSTIMG determines whether users can list available CD images using menu. # CHANGE determines whether users can edit CD layout files from menu. # DELETE determines whether users can delete CD files from menu. # ?????? WRITE appears if there are any defined write drives. # To eliminate WRITE, undefine CDWx or NAMx for ALL x in 1-9 and a-z. # TESTCD determines whether users can test/verify a CD against an image file. # CONFIG determines whether users can get into the setup menu from main menu. # HOTCNF defines extra hotkey for the setup menu; in case it's disabled. # OTHKEYx defines extra menu commands (up to 15 -- use 1-9 and A-F for x). # OTHDSCx are the menu descriptions for the 15 extra command keys (With ": "). # OTHCMDx are the extra commands. "%k" is for the key pressed, "%." for a "%". # You can add plain text between the options using OTHDSCx without OTHKEYx. # Commands can begin with QUERY: to ask Yes/No before executing command. # Begin with PAUSE: or ERROR: for pausing [always / error] after execution. # QUERY: must be first if also using either PAUSE: OR ERROR:. # QUITSEP is the separator line that prints between the other options and quit. # QUITDSC is the description for quit command, blanking it will hide option. ############################################################################### ############################################################################### # Settings for screen colors... ############################################################################### C0="\e[0m" CT="\e[1;33;41m" CL="\e[0;1;31m" CM="\e[0;1;33m" CC="\e[1;33;44m" CB="\e[1;37;44m" CE="\a\e[1;5;34;43m" #------------------------------------------------------------------------------ # C0=Normal color - background of screen, etc. # CT=Title at top of screen # CL=List color (CDs and drives) # CM=Menu color for text in menu # CC=Color of choice key in menu list # CB=Bold color # CE=Error message color #------------------------------------------------------------------------------ # ANSI Colors: 0=Normal;1=Bright;3x=Foreground color;4x=Background color # Where x in 3x and 4x above specifies the color. # Colors are 0=Black;1=Red;2=Green;3=Yellow;4=Blue;5=Magenta;6=Cyan;7=White # As a rule, add a 0 at the beginning when there's no background color (4x) # Use 1 (for bright) for most colors other than white # Color sequences start with "\e[" and end with "m"; separate numbers by ; # You can also \a for AlarmBell, \t for Tab, etc. See bash docs for more. ############################################################################### ############################################################################### # Settings for automatic drive selections... ############################################################################### CD_I="" CD_E="" CD_R="" CD_W="" CD_T="" #------------------------------------------------------------------------------ # CD_I Defines which drive to use to get disk info, blank = "ask user". # CD_E Defines which drive to use to erase, blank = "ask user". # CD_R Defines which drive to use to read, blank = "ask user". # CD_W Defines which drive to use to write, blank = "ask user". # CD_T Defines which drive to use to test disks, blank = "ask user". ############################################################################### ############################################################################### # Settings for program options... ############################################################################### AUTOHELP=".cds.auto.help" AUTOSHOW=1 ALLDEV=1 WARNTIME=81 IOPTS="" EOPTS="" ROPTS="--read-raw" WOPTS="-n --overburn --eject" TOPTS="--read-raw" #------------------------------------------------------------------------------ # AUTOHELP file is displayed at the start of each program run if found. # AUTOSHOW determines whether image files are always listed at top of menu. # ALLDEV determines whether multiple device names are shown in write choices. # WARNTIME number of minutes of free disk space below which a WARNING occurs. # IOPTS is added to info commands on all drives. # EOPTS is added to erase commands for re-writable disks on all drives. # ROPTS is added to read commands on all drives. # WOPTS is added to write commands on all drives. # TOPTS is added to read commands when verifying a disk on all drives. # NOTES: The read/write options can also be defined by drive selection menu: # IOPx is for defining additional (after IOPTS) options for info command. # EOPx is for defining additional (after EOPTS) options for erase command. # ROPx is for defining additional (after ROPTS) options for read command. # WOPx is for defining additional (after WOPTS) options for write command. # TOPx is for defining additional (after TOPTS) options when verifying. # i.e. Setting "WOP4=xxx" adds xxx after WOPTS value when writing choice 4. # YES it WOULD be nice to have options for each drive... in Version 2. ############################################################################### ############################################################################### # Settings for externally used commands and disk read/write commands... ############################################################################### CLEAR="clear" SLEEP="read -r -s -n 1 -t 3 junk" PAUSE="read -r -s -n 1 junk" EDIT="vi" VIEW="less" INFOCMD="cdrdao disk-info --driver generic-mmc-raw --device" WIPECMD="cdrdao blank --blank-mode minimal --device" READCMD="cdrdao read-cd --driver generic-mmc-raw --device" WRITECMD="cdrdao write --driver generic-mmc-raw --device" VERICMD="cdrdao read-cd --driver generic-mmc-raw --device" LISTDEV="cdrdao scanbus" DIFFCMD="diff -s -q" #------------------------------------------------------------------------------ # CLEAR is used to clear the screen at the start of each menu. # SLEEP is used to pause briefly when displaying non-essential messages. # PAUSE is used after "Deleted" and similar status messages. # EDIT is used to edit layouts and configuration files. # VIEW is used to view lists and the help file (must accept piped input). # INFOCMD, WIPECMD, READCMD, WRITECMD, VERICMD, and LISTDEV are disk commands. # DIFFCMD is used when verifying disks against image file--takes 2 file params. ############################################################################### ############################################################################### # Settings for setup and help files... ############################################################################### HELP="cds.help" CONF="cds.conf" #------------------------------------------------------------------------------ # HELP is the file showed by the help key. # CONF is the setup file. If value changed, will run the new file next [...] ############################################################################### ############################################################################### # Setting for main directory, where images are stored. ############################################################################### CD="$HOME/CDImages" #------------------------------------------------------------------------------ # The CD is where the program will change to and is where the disk files exist. ############################################################################### ############################################################################### # Settings for device names. ############################################################################### CDR1="ATA:0,0,0" CDW1="$CDR1" NAM1="ATA Primary Master (usually hard drive)" CDR2="ATA:0,1,0" CDW2="$CDR2" NAM2="ATA Primary Slave (sometimes CD/DVD location)" CDR3="ATA:1,0,0" CDW3="$CDR3" NAM3="ATA Secondary Master (usual CD/DVD location)" CDR4="ATA:1,1,0" CDW4="$CDR4" NAM4="ATA Secondary Slave (sometimes CD/DVD location)" CDR5="ATA:2,0,0" CDW5="$CDR5" NAM5="SATA or expansion card IDE drive 1 location" CDR6="ATA:3,0,0" CDW6="$CDR6" NAM6="SATA or expansion card IDE drive 2 location" CDR7="0,0,0" CDW7="$CDR7" NAM7="1st USB/SCSI drive" CDR8="1,0,0" CDW8="$CDR8" NAM8="2nd USB/SCSI drive" CDR9="2,0,0" CDW9="$CDR9" NAM9="3rd USB/SCSI drive" CDRa="3,0,0" CDWa="$CDRa" NAMa="4th USB/SCSI drive" CDRb="4,0,0" CDWb="$CDRb" NAMb="5th USB/SCSI drive" CDRc="5,0,0" CDWc="$CDRc" NAMc="6th USB/SCSI drive" CDRz="" CDWz="$CDW1 $CDW2 $CDW3 $CDW4 $CDW5 $CDW6 $CDW7 $CDW8 $CDW9 $CDWa $CDWb $CDWc" NAMz="All disk writers"