#ident	"@(#)sadmin:shell/hdsetup	35.4"
# This is the common code for the hdsetup routines, placed in /usr/lbin.

flags="-qq -k$$"
trap 'rm -f /tmp/xf_*; exit 1' 1 2 15

ETC=/etc
FMT=${ETC}/dinit
CONV=${ETC}/xformtrk
fmt=2
ffmt=2
pfmt=2
def_dev=1
def_add=n
contbad=n
secslip="no"
rdman="NA"
MANUF=2
SIZE=2
FFMT=
PFMT=
IFMT=
NEWFILE=n
SLIPFLAG=y
DELFLAG=y
RDMANFLAG=n
OLDFORM=n
MDEF=n
mflag=

validdevs='
	1.  m320_0 			13. m327_00
	2.  m320_1 			14. m327_10
	3.  m320_1d0 			15. m327_20
	4.  m320_1d1 			16. m327_30
	5.  m360_0 			17. m327_1d00
	6.  m360_2 			18. m327_1d10
	7.  m360_1d0 			19. m327_1d20
	8.  m360_1d2 			20. m327_1d30
	9.  m323_0 			21. m147_00
	10. m323_1 			22. m147_10
	11. m323_2 			23. m147_20
	12. m323_3 			24. m147_30'

# ************************* getdevice ******************************
# ask the user for drive info and determine the type parameter to dinit
# from the answers.  
getdevice() {
	echo "\n	Valid Devices Are:\c"
	echo "${validdevs}\n"
	device=`checklist ${flags} -D"${def_dev}" -H "Valid Devices: ${validdevs}"\
	-fe "enter the device (default: ${def_dev}) [q] :" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24`
	case "${device}" in
		'1') device=m320_0 
		     def_dev=1 ;;
		'2') device=m320_1 
		     def_dev=2 ;;
		'3') device=m320_1d0 
		     def_dev=3 ;;
		'4') device=m320_1d1 
		     def_dev=4 ;;
		'5') device=m360_0 
		     def_dev=5 ;;
		'6') device=m360_2 
		     def_dev=6 ;;
		'7') device=m360_1d0 
		     def_dev=7 ;;
		'8') device=m360_1d2 
		     def_dev=8 ;;
		'9') device=m323_0
		     def_dev=9 ;;
		'10') device=m323_1
		     def_dev=10 ;;
		'11') device=m323_2
		     def_dev=11 ;;
		'12') device=m323_3
		     def_dev=12 ;;
		'13') device=m327_00
		     def_dev=13 ;;
		'14') device=m327_10
		     def_dev=14 ;;
		'15') device=m327_20
		     def_dev=15 ;;
		'16') device=m327_30
		     def_dev=16 ;;
		'17') device=m327_1d00
		     def_dev=17 ;;
		'18') device=m327_1d10
		     def_dev=18 ;;
		'19') device=m327_1d20
		     def_dev=19 ;;
		'20') device=m327_1d30
		     def_dev=20 ;;
		'21') device=m147_00
		     def_dev=21 ;;
		'22') device=m147_10
		     def_dev=22 ;;
		'23') device=m147_20
		     def_dev=23 ;;
		'24') device=m147_30
		     def_dev=24 ;;
	esac
	case $device in
	    m320_[01] | m320_1d[01])
		echo '
	Valid Disk Sizes are:
	1. 40 Megabyte
	2. 70 Megabyte\n'
		SIZE=`checklist ${flags} -D"${SIZE}" -ef "What size is your disk (default: ${SIZE})?" 1 2 `
		case "${SIZE}" in
			'1') Sz=40
			     pr_sz="40Mb" ;;
			'2') Sz=70
			     pr_sz="70Mb" ;;
		esac
		DTYPE=m320${Sz}
		echo '
	Valid Manufacturers are:
	1. Toshiba
	2. Micropolis
	3. Miniscribe
	4. Priam\n'
		MANUF=`checklist ${flags} -D"${MANUF}" -ef "Who Manufactures your Winchester (default: ${MANUF})?" 1 2 3 4`
		case "${MANUF}" in
			'1') Mfg=t
			     pr_man="Toshiba" ;;
			'2') Mfg=m
			     pr_man="Micropolis" ;;
			'3') Mfg=s
			     pr_man="Miniscribe" ;;
			'4') Mfg=p
			     pr_man="Priam" ;;
		esac
		DTYPE=${DTYPE}${Mfg}
		secslip="NA"
		;;

	    m360_[02] | m360_1d[02])
		DTYPE=m360337
		Sz=NA
		pr_man="Fujitsu"
		pr_sz="337Mb"
		if [ "${CMD}" != "b" ]
		then
			if checkyn ${flags} -D"${SLIPFLAG}" -H"
Sector slipping is available as a form of bad track management.  If your 
controller supports this option and you wish to utilize it, answer yes.  " \
	-ef "Do you wish to use sector slipping (default: ${SLIPFLAG})? "
			then
				DTYPE=m360337s
				secslip="yes"
			else
				secslip="no"
			fi
		else
			secslip="NA"
		fi
		;;

	    m323_[0123] )
		pr_man="CDC"
		typedefault=1
		Sz=NA
		diskselect		# set DTYPE here
		if [ "${CMD}" != "b" ]
		then
			if checkyn ${flags} -D"${SLIPFLAG}" -H"
Sector slipping is available as a form of bad track management.  If your 
controller supports this option and you wish to utilize it, answer yes.  " \
	-ef "Do you wish to use sector slipping (default: ${SLIPFLAG})? "
			then
				DTYPE=${DTYPE}s
				secslip="yes"
			else
				secslip="no"
			fi
			if checkyn ${flags} -D"${RDMANFLAG}" -H"
The manufacturer supplies a bad track table on the disk itself.  If you
wish to utilize it rather than entering them into a file, answer yes.  " \
	-ef "Use the manufacturers defect list (default: ${RDMANFLAG})? "
			then
				rdman="yes"
			else
				rdman="no"
			fi
		else
			secslip="NA"
		fi
		;;
	    m327_0? | m327_1d0? )
		DTYPE=m327cdcIII
		typedefault=1
		Sz=NA
		secslip="NA"
		pr_man="CDC"
		pr_sz="NA"
		diskselect
		;;
	    m327_1? | m327_1d1? )
		DTYPE=m327micro
		typedefault=2
		Sz=NA
		secslip="NA"
		pr_man="Micropolis"
		pr_sz="NA"
		diskselect
		;;
	    m327_2? | m327_1d2? )
		DTYPE=m327cdcIV
		typedefault=3
		Sz=NA
		secslip="NA"
		pr_man="CDC"
		pr_sz="NA"
		diskselect
		;;
	    m327_3? | m327_1d3? )
		DTYPE=m327sea80
		typedefault=4
		Sz=NA
		secslip="NA"
		pr_man="Seagate"
		pr_sz="NA"
		diskselect
		;;
	    m147_0? )
		DTYPE=m147cdcIII
		typedefault=1
		Sz=NA
		secslip="NA"
		pr_man="CDC"
		pr_sz="NA"
		diskselect
		;;
	    m147_1? )
		DTYPE=m147micro
		typedefault=2
		Sz=NA
		secslip="NA"
		pr_man="Micropolis"
		pr_sz="NA"
		diskselect
		;;
	    m147_2? )
		DTYPE=m147cdcIV
		typedefault=3
		Sz=NA
		secslip="NA"
		pr_man="CDC"
		pr_sz="NA"
		diskselect
		;;
	    m147_3? )
		DTYPE=m147sea80
		typedefault=4
		Sz=NA
		secslip="NA"
		pr_man="Seagate"
		pr_sz="NA"
		diskselect
		;;
	    *)
		    ;;
	esac
    FMTDEV=/dev/rdsk/${device}s7
    case $device in
    m327* | m147* )
    	TFILE=NA ;;
    *)
    	TFILE=$ETC/badtracks/${device} ;;
    esac
}

# After the defaults had been set when choosing the device name, the
# real type is now selected.
diskselect() {
   case $device in
   m323* )
	valtypes='
	1.  m323182	- CDC 182Mb
	2.  m323390	- Wren V'
	echo "${valtypes}\n"
	newtype=`checklist ${flags} -D"${typedefault}" -ef "What is the disk type (default: ${typedefault})? " 1 2`
	case "${newtype}" in
		'1') DTYPE=m323182
		     pr_sz="182Mb" ;;
		'2') DTYPE=m323390
		     pr_sz="390Mb" ;;
	esac
	;;
   m327* )
	valtypes='
	1.  m327cdcIII	- Wren III
	2.  m327micro	- Micropolis
	3.  m327cdcIV	- Wren IV
	4.  m327sea40	- Seagate 48Mb
	5.  m327sea80	- Seagate 85Mb
	6.  m327maxtor	- Maxtor'
	echo "${valtypes}\n"
	newtype=`checklist ${flags} -D"${typedefault}" -ef "What is the disk type (default: ${typedefault})? " 1 2 3 4 5 6`
	case "${newtype}" in
		'1') DTYPE=m327cdcIII
		     pr_man=CDC ;;
		'2') DTYPE=m327micro
		     pr_man=Micropolis ;;
		'3') DTYPE=m327cdcIV
		     pr_man=CDC ;;
		'4') DTYPE=m327sea40
		     pr_man=Seagate ;;
		'5') DTYPE=m327sea80
		     pr_man=Seagate ;;
		'6') DTYPE=m327maxtor
		     pr_man=Maxtor ;;
	esac
	;;
   m147* )
	valtypes='
	1.  m147cdcIII	- Wren III
	2.  m147micro	- Micropolis
	3.  m147cdcIV	- Wren IV
	4.  m147sea40	- Seagate 48Mb
	5.  m147sea80	- Seagate 85Mb
	6.  m147maxtor	- Maxtor'
	echo "${valtypes}\n"
	newtype=`checklist ${flags} -D"${typedefault}" -ef "What is the disk type (default: ${typedefault})? " 1 2 3 4 5 6`
	case "${newtype}" in
		'1') DTYPE=m147cdcIII
		     pr_man=CDC ;;
		'2') DTYPE=m147micro
		     pr_man=Micropolis ;;
		'3') DTYPE=m147cdcIV
		     pr_man=CDC ;;
		'4') DTYPE=m147sea40
		     pr_man=Seagate ;;
		'5') DTYPE=m147sea80
		     pr_man=Seagate ;;
		'6') DTYPE=m147maxtor
		     pr_man=Maxtor ;;
	esac
	;;
   *)
	return ;;
   esac
}

# ************************* get320filefmt ******************************
# the file for the 320 can be in any format.  Ask which it is.
get320filefmt() {
	echo '
	Valid FILE formats are:
	1. <Track>
	2. <Head> <Cylinder>
	3. <Log Device> <Block>\n'
	fmt=`checklist ${flags} -H"
The format of the existing badtrack file must be known before we can do any
additions or conversions.

Once you select a file format, you will not be able to change it during
this invocation of the menu option.  If you want to just look at the file,
select the 'track' option.  You may be able to tell by the data which
format it really is in.  If you have guessed wrong, quit and start again from
the 'HARD DISK SETUP' menu.

	Valid FILE formats are:
	1. <Track>
	2. <Head> <Cylinder>
	3. <Log Device> <Block>

" -D"${ffmt}" -ef "In what format is the file $TFILE (default: ${ffmt})? " 1 2 3 `
	case "${fmt}" in
		'1') FFMT=t
		     prfmt="TRACK" ;;
		'2') FFMT=c
		     prfmt="HEAD,CYL" ;;
		'3') FFMT=d
		     prfmt="DEVICE,BLK" ;;
	esac
}

# ************************* get320inpfmt ******************************
get320inpfmt() {
	echo '
	Valid INPUT formats are:
	1. <Track>
	2. <Head> <Cylinder>
	3. <Log Device> <Block>\n'
	fmt=`checklist ${flags} -H"
You may enter track numbers in any of the valid forms.  The numbers will be
converted, if necessary, to the format of the badtrack file before being
entered.

	Valid INPUT formats are:
	1. <Track>
	2. <Head> <Cylinder>
	3. <Log Device> <Block>

" -D"${fmt}" -ef "In what format will you enter the data (default: ${fmt})? " 1 2 3`
	case "${fmt}" in
		'1') IFMT=t ;;
		'2') IFMT=c ;;
		'3') IFMT=d ;;
	esac
}

# ************************* get320prfmt ******************************
# The badspots can be printed in different forms for the 320.  Ask which.
get320prfmt() {
	echo '
	Valid PRINT formats are:
	1. <Track>
	2. <Head> <Cylinder>
	3. <Log Device> <Block> \n'
	fmt=`checklist ${flags} -H"
You may select at any time the first two formats for display but you may
select the last, <dev><blk> format only if the file is already in that
format.  

The original file will NOT be changed if you, regardless of the format you
choose.

	Valid PRINT formats are:
	1. <Track>
	2. <Head> <Cylinder>
	3. <Log Device> <Block>

" -D"${pfmt}" -ef "Display file in which format (default: ${pfmt})? " 1 2 3`
	case "${fmt}" in
		'1') PFMT=t ;;
		'2') PFMT=c ;;
		'3') PFMT=d ;;
	esac
}

# ************************* getbads ******************************
# If formatting or setting up config/bad tracks, and we don't yet have a 
# badtracks file to work from, get current bad list from disk.  If format or 
# config is blown, this may fail, but it's worth a try.
getbads() {

# ask if they want to delete list
if [ -f "$TFILE" ]
then
  	if checkyn ${flags} -H"
"Delete" will remove the file in /etc/badtracks which corresponds to 
the device selected.  Delete this file if you wish to read bad spots from
the disk; otherwise the existing list of bad spots will be used.

" -D"${DELFLAG}" -ef "Delete existing bad spot list (default: ${DELFLAG})? "
    then

		rm -f $ETC/badtracks/${device}
	fi
fi
if [ ! -f "$TFILE" ]
then
        mkbadtrack	# get a baseline file, then they can edit
else			# make sure there are no slashes in the file
	sed -e "s/\// /g" ${TFILE} > /tmp/xf_sed
	mv /tmp/xf_sed ${TFILE}
fi
while :
do
	case `checklist ${flags} -H"
If you want to add any other badtrack entries before formatting, do it
here.  If you are formatting a 320 device, you will be able to enter the
data in any format, regardless of the format of the file.  The data will
be stored in head, cylinder format but you can view the file in any other 
format to check your entries.

If you are formatting something other than a 320 device, you must enter
the badspots in Head, Cylinder, BytesFromIndex form.  If you do not know
the bytes from index for an entry, enter -1.

If you wish to neither add nor view, just select 'continue'.

" -fep 'Do you want to view the bad track list, add to the list 
or continue [v, a, c, q]?' view add continue ` in
	view )
		case $device in
	    	m320_[01] | m320_1d[01])
	    if [ "$NEWFILE" = 'y' ]
	    then
		FFMT=c		# If we made the file, it's cyl fmt
		NEWFILE=n
	    else
		if [ -z "$FFMT" ]
		then
				get320filefmt	
		fi
	    fi
	    	get320prfmt
			;;
	
	    	m360_[02] | m360_1d[02] | m323_[0123] )
			FFMT=b		# If we made the file, it's cyl/bfi fmt
			PFMT=b		
			;;
	    	*)
		    	;;
		esac
	    if [ ${PFMT} = ${FFMT} ]
	    then
	    	/usr/lbin/prbadlist ${PFMT} < ${TFILE} 
	    else
		if [ ${PFMT} = 'd' ]
		then
			echo "\n\tYou may only view in this format if the file is already"
			echo "\tformatted as such.  The data cannot be converted to that type.\n"
			continue
		fi
	    	${CONV} -I ${FFMT} -O ${PFMT} -t ${TFILE} ${DTYPE} ${device} 2>/dev/null
	    	if [ $? != 0 ]
	    	then
    			echo "Unable to convert file to the requested format."
	    		rm -f /tmp/xf_${device}
	    	else
	    		/usr/lbin/prbadlist ${PFMT} < /tmp/xf_${device} 
	    		rm -f /tmp/xf_${device}
	    	fi
	    fi
	    ;;   # end case VIEW
	add )
	case $device in
	m320_[01] | m320_1d[01])
	    if [ "$NEWFILE" = 'y' ]
	    then
		FFMT=c		
		NEWFILE=n
	    else
		if [ -z "$FFMT" ]
		then
	    			get320filefmt
		fi
	    fi
	    	get320inpfmt
	    if [ ${FFMT} = 'd' -a ${IFMT} != 'd' ]	
	    then
		${CONV} -I d -O c -t ${TFILE} ${DTYPE} ${device} 2>/dev/null
	    	cat /tmp/xf_${device} > ${TFILE} 2>/dev/null
		echo "\nNOTICE: The file ${TFILE} has been converted from <dev> <blk>"
		echo "format to <head> <cyl> format in order to add your input data.\n"
	    	rm -f /tmp/xf_${device}
		FFMT=c
		prfmt=HEAD,CYL
	    fi
	    ${CONV} -I ${IFMT} -O ${FFMT} ${DTYPE} ${device} 2>/dev/null
	    if [ $? != 0 ]
	    then
    		if checkyn ${flags} -H"
For some reason, the data could not be added to your bad track file.  If you
choose to continue, the input will consist of the data already in the file.
If you quit, you will be returned to the 'setup' menu.

" -D"${contbad}" -ef "Unable to get new input.  Continue (default: ${contbad})? "
		then
	    		rm -f /tmp/xf_${device}
		else
			exit 1
		fi
	    else
	    	cat /tmp/xf_${device} >> ${TFILE} 2>/dev/null
	    	rm -f /tmp/xf_${device}
  	    	echo "\n\tThe new bad tracks have "
	    	echo "\tbeen appended to $TFILE.\n"
	    fi
	    ;;
	
	m360_[02] | m360_1d[02] | m323_[0123])
		addnewbad
		;;
	*)
	  	;;
	esac		# end device options
	    ;;		# end case ADD
	continue )
		break ;;
	esac
done 
FMODES="-t $TFILE $FMODES" 
}

# ************************* addnewbad ******************************
# add bad tracks in head, cylinder, bfi format; append to TFILE
addnewbad() {
	echo "\nEnter bad track numbers as <head> <cylinder> <bfi>  (Use"
	echo "-1 for an unknown bfi field);  End with a period (.): "
	while read INP 
	do
		if [ "${INP}" = "." ]
		then
			break
    fi
		set ${INP}
		if [ $# -ne 3 ]
		then
			echo "Bad input: enter as <head> <cylinder> <bfi>"
		else
			echo $1 $2 $3 >> ${TFILE}
		fi
	done
}

# ************************* mkbadtrack ******************************
# try to read the bad track list off the disk.  After this function, there
# will either be a list off the disk or an empty file (FE cyls. are added
# to all 70Mg drive entries.
mkbadtrack() {
	NEWFILE=y
	${FMT} -r $DTYPE $FMTDEV >$TFILE 2>/dev/null
	if [ $? != 0 ]			# if we can't recover disk list
	then				# have an empty file.  
	    case $device in
	   	m323_[0123] )
			echo "\n\tUnable to read bad spots from m323 drive."
			echo "\n\tPlease reformat using the manufacturers defect list,\n\tor enter the hd,cyl/BFI by hand."
			exit
			;;
		*) ;;
	    esac
	    if [ ${Sz} -eq 70 ]		# (FE list for 70 Mg drives)
	    then
	    	cat $ETC/diskalts/m320fix70${Mfg}.hc > $TFILE 2>/dev/null
		if [ $? = 0 ]
		then
  	    		echo "\n\tThe file $TFILE has been updated with"
	    		echo "\tonly the list of FE cylinders.\n"
		else
			echo "\n\tCannot get list of FE cylinders.  The file"
  	    		echo "\t${TFILE} contains no bad tracks.\n"
		fi
	    else
		> $TFILE	# make sure the file is empty
  	    	echo "\n\tThe file $TFILE contains no bad tracks.\n"
	    fi
	else
	    if [ ${Sz} -eq 70 ]
	    then
	    	cat $ETC/diskalts/m320fix70${Mfg}.hc >> $TFILE 2>/dev/null
		if [ $? = 0 ]
		then
  	    		echo "\n\tThe file $TFILE has been updated with"
	    		echo "\tthe badtrack list, including FE cyls.\n"
		else
			echo "\n\tCannot get list of FE cylinders.  The file"
  	    		echo "\t${TFILE} contains only the list from the disk.\n"
		fi
	    else
  	    	echo "\n\tThe file $TFILE has been updated"
	    	echo "\twith the badtrack list off the disk.\n"
	    fi
	fi
	# make sure there are no slashes in the file
	sed -e "s/\// /g" ${TFILE} > /tmp/xf_sed
	mv /tmp/xf_sed ${TFILE}
}

# ask the user if root and user should be created
selectmkfs() {
	if checkyn ${flags} -D"${MDEF}" -H"
If you choose not to create filesystems, all space will be placed in
slice 0.  To distribute space to other slices and to create filesystems 
at a later time, use sledit(1M)." \
	-ef "Create root and usr file systems (default: ${MDEF})? "
    then
		mflag=m
    fi
}

# START MAIN
echo '\nAnytime you want to quit, type "q".
If you are not sure how to answer any prompt, type "?" for help,
or see the Administrator\047s Guide.
\nIf a default appears in the question, press <RETURN> for the default.
'
if [ $# -ne 1 ]
then
	exit 1
fi
CMD=$1
while :
do
case "$CMD" in
	f*)
		getdevice
		selectmkfs 	# this sets mflag
		if [ "${rdman}" = "yes" ]
		then
			FMODES="-${mflag}fR ${DTYPE} ${FMTDEV}"
		else
			FMODES="-${mflag}f ${DTYPE} ${FMTDEV}"
			case $device in 
	   		m327* | m147*)
				;;
			*)
				getbads ;;
			esac
		fi
		prcmd="FORMAT"
		;;
	i*)
		getdevice
		FMODES="${DTYPE} ${FMTDEV}"
	    	case $device in
	   	m327* | m147*)
			;;
		*)
			getbads ;;
		esac
		prcmd="INITIALIZE"
		;;
	b*)
		getdevice
		FMODES="-b /stand/m68k/boots/vmeboot ${DTYPE} ${FMTDEV}"
		prcmd="INSTALL BOOTLOADER"
		prfmt=NA
		TFILE=NA
		;;
	*)
		exit 1
		;;
esac

	if [ -z "${prfmt}" ]
	then
	case $device in
	    m320_[01] | m320_1d[01])
		prfmt="HEAD,CYL" ;;

	    m360_[02] | m360_1d[02] | m323_[0123])
		prfmt="HEAD,CYL,BFI" ;;
	    m327* | m147*)
		prfmt=NA ;;
	    *) 
		;;
	esac
	fi
	echo "\nThis is the information for the operation:\n
	operation:	${prcmd}
	entered device:	${device}
	manufacturer:	${pr_man}
	disk size:    	${pr_sz}
	badtrack file:	${TFILE}
	file format:	${prfmt}
	device name:	${FMTDEV}
	device type:	${DTYPE}
	sector slip:	${secslip}
	use manuf list:	${rdman}
"
	case `checklist ${flags} -fep 'Do you want to begin operation, or change the information [b, c, q]?' begin change ` in
	begin )

	    case "${CMD}" in
		f*)
		echo "\n*** Begin format of  ${FMTDEV}"
		    ;;
		i*)
		echo "\n*** Begin initialization configuration on  ${FMTDEV}"
		    ;;
		b*)
		echo "\n*** Begin vmeboot install as bootloader on  ${FMTDEV}"
		    ;;
	    *)	;;
	    esac
	    ${FMT} $FMODES >/dev/null 2>&1
	    if [ $? != 0 ]
	    then
		    echo "\nThe format has failed.  Contact your "
		    echo "service representative for assistance.\n"
		    exit 1
	    elif [ "${CMD}" != b ]
	    then
		case $device in
	    	m327* | m147*)
			echo "\n\t*****   The operation is complete.   *****\n"
		;;
		*) 
		    ${FMT} -r ${DTYPE} ${FMTDEV} > $TFILE 2>/dev/null
		    DSTAT=$?
		    sed -e "s/\// /g" ${TFILE} > /tmp/xf_sed
		    mv /tmp/xf_sed ${TFILE}
		    if [ "${DSTAT}" = 0 ]
		    then
			    echo "\n\tThe operation is complete."
			    echo "\n\tThe current bad track list for disk $device "
			    echo "\thas been preserved in $TFILE"
		    else
			    echo "\n\tThe current bad track list for disk $device"
			    echo "\tcan't be found after this operation.  Contact"
			    echo "\tyour service representative for assistance."
		    fi
		;;
		esac
	    else
		    echo "\n\tThe bootloader installation is complete."
	    fi
	    if checkyn ${flags} -D"n" -ef "Format another disk (default: n)? "
	    then
		    continue
	    else
		    exit
	    fi
	    ;;
	change )
	    ;;
	esac
done
