#! /bin/bash ############################################################################### # Settings for menu choices... ############################################################################### INFOCD=1 WIPECD=1 LSTIMG=0 CHANGE=0 DELETE=1 TESTCD=1 CONFIG=0 HOTCNF=":" OTHKEY1="" OTHDSC1="----------" OTHKEY2="'" OTHDSC2=": Copy from top drive to bottom." OTHCMD2="ERROR:cdrdao copy --source-device ATA:1,0,0 --source-driver generic-mmc-raw --read-raw --on-the-fly --device ATA:3,0,0 --driver generic-mmc-raw -n --overburn --eject" OTHKEYA="" OTHDSCA="----------" OTHKEYB="0" OTHDSCB=": Turn off computer." OTHCMDB="QUERY:sudo /sbin/halt" OTHKEYC="1" OTHDSCC=": Reboot computer." OTHCMDC="QUERY:sudo /sbin/reboot" #OTHKEYE="" #OTHDSCE="----------" #OTHKEYF="@" #OTHDSCF=": Run graphical login." #OTHCMDF="sudo /sbin/init 4" QUITSEP="" QUITDSC="" #------------------------------------------------------------------------------ # 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="pico" 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="/home/cds/church.help" CONF="/home/cds/church.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="/c/CDImages" #------------------------------------------------------------------------------ # The CD is where the program will change to and is where the disk files exist. ############################################################################### ############################################################################### # Settings for device names. ############################################################################### CDR1="ATA:1,0,0" CDW1="$CDR1" NAM1="the top CDROM in case" CDR2="ATA:2,0,0" CDW2="$CDR2" NAM2="the middle CD in case" CDR3="ATA:3,0,0" CDW3="$CDR3" NAM3="the bottom CD in case" CDR4="2,0,0" CDW4="$CDR4" NAM4="1st USB/SCSI CD Drive" CDR5="3,0,0" CDW5="$CDR5" NAM5="2nd USB/SCSI CD Drive" CDR6="4,0,0" CDW6="$CDR6" NAM6="3rd USB/SCSI CD Drive" CDR7="5,0,0" CDW7="$CDR7" NAM7="4th USB/SCSI CD Drive" CDR8="6,0,0" CDW8="$CDR8" NAM8="5th USB/SCSI CD Drive" CDR9="7,0,0" CDW9="$CDR9" NAM9="6th USB/SCSI CD Drive" CDRa="" CDWa="$CDW1 $CDW2 $CDW3" NAMa="All internal CD Writers" CDRb="" CDWb="$CDW1 $CDW2 $CDW3 $CDW4" NAMb="All and 1 external" CDRc="" CDWc="$CDW1 $CDW2 $CDW3 $CDW4 $CDW5" NAMc="All and 2 external" CDRd="" CDWd="$CDW1 $CDW2 $CDW3 $CDW4 $CDW5 $CDW6" NAMd="All and 3 external" CDRe="" CDWe="$CDW1 $CDW2 $CDW3 $CDW4 $CDW5 $CDW6 $CDW7" NAMe="All and 4 external" CDRf="" CDWf="$CDW1 $CDW2 $CDW3 $CDW4 $CDW5 $CDW6 $CDW7 $CDW8" NAMf="All and 5 external" CDRg="" CDWg="$CDW1 $CDW2 $CDW3 $CDW4 $CDW5 $CDW6 $CDW7 $CDW8 $CDW9" NAMg="ALL 9 Possible CD-Writers" NAMh="" NAMi="" NAMj="" NAMk="" NAMl="" NAMm="" NAMn="" NAMo="" NAMp="" NAMq="" NAMr="" NAMs="" NAMt="" NAMu="" NAMv="" NAMw="" NAMx="" NAMy="" NAMz="" #------------------------------------------------------------------------------ # Turn on DMA, 32bit, and interrupts for drives. #------------------------------------------------------------------------------ sudo /usr/sbin/hdparm -q -c1 -q -d1 -q -u1 /dev/hda /dev/hdc /dev/hde /dev/hdg