#!/bin/bash

. bk_functions

while [ 0 ]; do

	dialog --backtitle "Linux Bootkit $VERSION" \
	       --title "Configuration Menu"\
	       --menu "\nIf you have trouble using the arrow keys, you can use '+', '-',\n\
TAB instead. Which option would you like?" 20 74 10 \
"A" "Floppy disk device [$DISKETTEDEV]" \
"B" "Path and filename of kernel [$KERNELPATH]" \
"C" "Path to floppy mount point [$MOUNTPOINT]" \
"D" "Path/filename of libc link [$LIBCLINK]" \
"RETURN" "Return to the main menu" 2>/tmp/.confselect

if [ $? = 1 -o $? = 255 ]; then 
	rm -f /tmp/.confselect 2>/dev/null
	reset
	exit
fi

CONFSEL="`cat /tmp/.confselect`"
rm -f /tmp/.confselect 2>/dev/null

# Process Selected Option

if [ "$CONFSEL" = "A" ]; then
	getdata "Enter the desired floppy device" $DISKETTEDEV
	DISKETTEDEV=`cat /tmp/.getdata.$$`
fi

if [ "$CONFSEL" = "B" ]; then
	getdata "Enter path/filename of the kernel" $KERNELPATH
	KERNELPATH=`cat /tmp/.getdata.$$`
fi

if [ "$CONFSEL" = "C" ]; then
	getdata "Path to floppy mount point" $MOUNTPOINT
	MOUNTPOINT=`cat /tmp/.getdata.$$`
fi

if [ "$CONFSEL" = "D" ]; then
	getdata "Path/filename of libc link" $LIBCLINK
	LIBCLINK=`cat /tmp/.getdata.$$`
fi


if [ "$CONFSEL" = "RETURN" ]; then
	reset
	break
fi

bkSaveOptions
. ./.bootkit.config

done

rm -f /tmp/.getdata.$$ 2>/dev/null
