summaryrefslogtreecommitdiffstats
path: root/release/rc.local
blob: d583381446f5954a2682e99d6b9f3107f85af575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# $FreeBSD$

: ${DIALOG_OK=0}
: ${DIALOG_CANCEL=1}
: ${DIALOG_HELP=2}
: ${DIALOG_EXTRA=3}
: ${DIALOG_ITEM_HELP=4}
: ${DIALOG_ESC=255}

TERM=xterm; export TERM # XXX: serial consoles

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
	BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
	trap true SIGINT	# Ignore cntrl-C here
	bsdinstall
	if [ $? -eq 0 ]; then
		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

OpenPOWER on IntegriCloud