123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #!/bin/sh
- . gettext.sh
- export TEXTDOMAIN=cdburner-wizard
- export OUTPUT_CHARSET=UTF-8
- DRIVESFND="`probedisk`"
- OPTICALDRVSFND="`echo "$DRIVESFND" | grep '|optical|'`"
- SELECTIONS="`echo "$OPTICALDRVSFND" | cut -f 1,3 -d "|" | tr " " "_" | tr "|" " " | tr '$' "_"`"
- if [ -z "$SELECTIONS" ]; then
- pupmessage -bg "red" -center -name "burnwiz" -title "$(gettext 'CD/DVD driver Wizard: FAILURE')" "$(gettext 'no optical drive found')"
- exit 0
- fi
- nothing="$(gettext 'nothing')"
- CDROMDEV=$nothing
- CDROMLINK=$nothing
- if [ -e /dev/cdrom ];then
- CDROMDEV="/dev/`readlink /dev/cdrom | sed -e 's%/dev/%%'`"
- CDROMLINK="`readlink /dev/cdrom`"
- fi
- DVDDEV=$nothing
- DVDLINK=$nothing
- if [ -e /dev/dvd ];then
- DVDDEV="/dev/`readlink /dev/dvd | sed -e 's%/dev/%%'`"
- DVDLINK="`readlink /dev/dvd`"
- fi
- MSG1="$(gettext 'Welcome to my CD and DVD Drive Wizard!')"
- BGCOLOR1="#ffc0c0"
- CHOSECD="$(gettext 'Choose_cdrom')"
- CHOSEDVD="$(gettext 'Choose_dvd')"
- while :; do
- xmessage -bg "$BGCOLOR1" -center -name "burnwiz" -title "$(gettext 'Optical Drive Wizard')" -buttons \
- "${CHOSECD}":11,"${CHOSEDVD}":20,"$(gettext 'HELP')":15,"$(gettext 'EXIT')":13 \
- -file -<<FILETXT
-
- $MSG1
- $(gettext 'Puppy has probed your PC and found these CD/DVD drives:')
- $SELECTIONS
- `eval_gettext 'Puppy thinks the default CDROM drive is: ${CDROMDEV}'`
- `eval_gettext 'Puppy thinks the default DVD drive is: ${DVDDEV}'`
- DEVICE LINKS:
- `eval_gettext '/dev/cdrom is currently linked to: ${CDROMLINK}.'`
- `eval_gettext '/dev/dvd is currently linked to: ${DVDLINK}.'`
- `eval_gettext 'If you disagree with these choices, click the "${CHOSECD}"
- or "${CHOSEDVD}" button to change the selection.'`
- FILETXT
- XREPLY=$?
- if [ $XREPLY -eq 11 ];then
- BGCOLOR1="#c0e0ff"
-
- CDROMD0="`Xdialog --wmclass "burnwiz" --title "$(gettext 'CD/DVD drive Wizard')" --stdout --menubox "$(gettext 'Choose which is the CDROM drive:')" 0 48 4 $SELECTIONS 2> /dev/null `"
- if [ ! $? -eq 0 ];then
- MSG1="`eval_gettext 'YOU MADE NO CHOICE FOR CDROM DRIVE, KEEPING ${CDROMDEV}'`"
- else
- MSG1="`eval_gettext 'YOU JUST CHOSE ${CDROMD0} AS THE CDROM DRIVE'`"
- CDROMDEV="$CDROMD0"
- CDROMLINK="$CDROMD0"
-
- echo -n $CDROMLINK | cut -f 3 -d '/' > /etc/cdromdevice
- rm -f /dev/cdrom
- ln -s $CDROMLINK /dev/cdrom
- fi
- fi
- if [ $XREPLY -eq 20 ];then
- BGCOLOR1="#c0e0ff"
-
- DVDD0="`Xdialog --wmclass "burnwiz" --title "$(gettext 'CD/DVD drive Wizard')" --stdout --menubox "$(gettext 'Choose which is the DVD drive:')" 0 48 4 $SELECTIONS 2> /dev/null `"
- if [ ! $? -eq 0 ];then
- MSG1="`eval_gettext 'YOU MADE NO CHOICE FOR DVD DRIVE, KEEPING ${DVDDEV}'`"
- else
- MSG1="`eval_gettext 'YOU JUST CHOSE ${DVDD0} AS THE DVD DRIVE'`"
- DVDDEV="$DVDD0"
- DVDLINK="$DVDD0"
-
- echo -n $DVDLINK | cut -f 3 -d '/' > /etc/dvddevice
- rm -f /dev/dvd
- ln -s $DVDLINK /dev/dvd
- fi
- fi
- if [ $XREPLY -eq 15 ];then
- pupmessage -bg "SkyBlue" -center -title "$(gettext 'CD/DVD driver Wizard: HELP')" "$(gettext '/dev/dvd and /dev/cdrom are links to the actual devices, for example, a link to /dev/sdc. These should point to the drives that you want to read from.
- For example, my PC has two drives, a DVD read-only drive and a CD-burner drive.
- I point *both* /dev/dvd and /dev/cdrom to the DVD drive, although I could have pointed /dev/cdrom to the burner drive (a DVD drive can also read CDs, so I chose it as my default for reading both CDs and DVDs).
- There are various applications for reading from CD or DVD. For example, Gxine can play audio CDs and video DVDs. Some of these applications require that /dev/cdrom
- or /dev/dvd point to the correct devices.')"
- fi
- if [ $XREPLY -eq 13 ];then
- break
- fi
- if [ $XREPLY -eq 0 ];then
- break
- fi
- if [ $XREPLY -eq 1 ];then
- break
- fi
- done
|