#!/bin/bash

. bk_functions

	dialog --backtitle "Linux Bootkit $VERSION" \
	       --title "Bootkit Configuration Menu"\
	       --separate-output\
	       --checklist "\nIf you have trouble using the arrow keys, you can use '+', '-',\n\
TAB instead. Which option would you like?" 20 74 10 \
"RAMDISK" "Use kernel RAMDISK feature? [recommended]" $RAMDISK \
"COPYLIBC" "Copy the runtime library to root diskette?" $COPYLIBC \
"ADDBKUSER" "Add the default bootkit user?" $ADDBKUSER 2>/tmp/.rootselect

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

# Process Selected Options

RAMDISK=OFF
COPYLIBC=OFF
ADDBKUSER=OFF

while read ROOTSEL
do
	if [ "$ROOTSEL" = "RAMDISK" ]
	then
		RAMDISK=ON
	fi

	if [ "$ROOTSEL" = "COPYLIBC" ]
	then
		COPYLIBC=ON
	fi

	if [ "$ROOTSEL" = "ADDBKUSER" ]
	then
		ADDBKUSER=ON
	fi

done < /tmp/.rootselect

bkSaveOptions

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