-dialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0
-
-case $? in
-$DIALOG_OK) # Install
- # If not netbooting, have the installer configure the network
- dialog --backtitle "FreeBSD Installer" --title "Complete" --yes-label "Reboot" --no-label "Live CD" --yesno "Installation of FreeBSD complete! Would you like to reboot into the installed system now?" 0 0 && reboot
- else
- . /etc/rc.local
- fi
- ;;
-$DIALOG_CANCEL) # Live CD
- exit 0
- ;;
-$DIALOG_EXTRA) # Shell
- clear
- echo "When finished, type 'exit' to return to the installer."
- /bin/sh
- . /etc/rc.local
- ;;
-esac
+while [ 1 ]
+do
+ exec 3>&1
+ selection=$(dialog \
+ --backtitle "FreeBSD Installer" \
+ --title "Welcome" \
+ --clear \
+ --cancel-label "Reboot" \
+ --nocancel \
+ --menu "Welcome to FreeBSD! Would you like to begin an installation, restore a system or use the live CD?" \
+ 0 0 4 \
+ "1" "Install" \
+ "2" "Shell" \
+ "3" "Live CD" \
+ "4" "Reboot" \
+ 2>&1 1>&3)
+ exit_status=$?
+ exec 3>&-
+ case $exit_status in
+ $DIALOG_OK) # Install
+ ;;
+ $DIALOG_ESC)
+ clear
+ continue
+ ;;
+ esac
+ case $selection in
+ 1) # Install
+ # If not netbooting, have the installer configure the network
+ dialog --backtitle "FreeBSD Installer" --title "Complete" --yes-label "Reboot" --no-label "Live CD" --yesno "Installation of FreeBSD complete! Would you like to reboot into the installed system now?" 0 0 && reboot
+ fi
+ ;;
+ 2) # Shell
+ clear
+ echo "When finished, type 'exit' to return to the main menu."