rc.local revision 220500
1#!/bin/sh
2# $FreeBSD: head/release/rc.local 220500 2011-04-09 14:25:58Z nwhitehorn $
3
4: ${DIALOG_OK=0}
5: ${DIALOG_CANCEL=1}
6: ${DIALOG_HELP=2}
7: ${DIALOG_EXTRA=3}
8: ${DIALOG_ITEM_HELP=4}
9: ${DIALOG_ESC=255}
10
11TERM=xterm; export TERM # XXX: serial consoles
12
13dialog --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
14
15case $? in
16$DIALOG_OK)	# Install
17	BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
18	trap true SIGINT	# Ignore cntrl-C here
19	bsdinstall
20	if [ $? -eq 0 ]; then
21		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
22	else
23		. /etc/rc.local
24	fi
25	;;
26$DIALOG_CANCEL)	# Live CD
27	exit 0
28	;;
29$DIALOG_EXTRA)	# Shell
30	clear
31	echo "When finished, type 'exit' to return to the installer."
32	/bin/sh
33	. /etc/rc.local
34	;;
35esac
36
37