xref: /freebsd-src/usr.sbin/bsdinstall/scripts/finalconfig (revision bbe2a1da2df639c616869aa838244c8094779bd4)
1a6d20207SPierre Pronchery#!/bin/sh
2a6d20207SPierre Pronchery#-
3a6d20207SPierre Pronchery# Copyright (c) 2011 Nathan Whitehorn
4a6d20207SPierre Pronchery# Copyright (c) 2013-2018 Devin Teske
5a6d20207SPierre Pronchery# All rights reserved.
6a6d20207SPierre Pronchery#
7a6d20207SPierre Pronchery# Redistribution and use in source and binary forms, with or without
8a6d20207SPierre Pronchery# modification, are permitted provided that the following conditions
9a6d20207SPierre Pronchery# are met:
10a6d20207SPierre Pronchery# 1. Redistributions of source code must retain the above copyright
11a6d20207SPierre Pronchery#    notice, this list of conditions and the following disclaimer.
12a6d20207SPierre Pronchery# 2. Redistributions in binary form must reproduce the above copyright
13a6d20207SPierre Pronchery#    notice, this list of conditions and the following disclaimer in the
14a6d20207SPierre Pronchery#    documentation and/or other materials provided with the distribution.
15a6d20207SPierre Pronchery#
16a6d20207SPierre Pronchery# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17a6d20207SPierre Pronchery# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18a6d20207SPierre Pronchery# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19a6d20207SPierre Pronchery# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20a6d20207SPierre Pronchery# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21a6d20207SPierre Pronchery# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22a6d20207SPierre Pronchery# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a6d20207SPierre Pronchery# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24a6d20207SPierre Pronchery# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25a6d20207SPierre Pronchery# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a6d20207SPierre Pronchery# SUCH DAMAGE.
27a6d20207SPierre Pronchery#
28a6d20207SPierre Pronchery# $FreeBSD$
29a6d20207SPierre Pronchery
30a6d20207SPierre ProncheryBSDCFG_SHARE="/usr/share/bsdconfig"
31a6d20207SPierre Pronchery. $BSDCFG_SHARE/common.subr || exit 1
32a6d20207SPierre Pronchery
33a6d20207SPierre Pronchery: ${BSDDIALOG_OK=0}
34a6d20207SPierre Pronchery
35a6d20207SPierre Proncherywhile true; do
36a6d20207SPierre Pronchery	exec 5>&1
37a6d20207SPierre Pronchery	REVISIT=$(bsddialog --backtitle "$OSNAME Installer" \
38ac78e3e9SPierre Pronchery	    --title "Final Configuration" --ok-label "Select" \
39ac78e3e9SPierre Pronchery	    --cancel-label "Finish" --default-no --menu \
40a6d20207SPierre Pronchery	    "Setup of your $OSNAME system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \
41a6d20207SPierre Pronchery		"Add User" "Add a user to the system" \
42a6d20207SPierre Pronchery		"Root Password" "Change root password" \
43a6d20207SPierre Pronchery		"Hostname" "Set system hostname" \
44a6d20207SPierre Pronchery		"Network" "Networking configuration" \
45a6d20207SPierre Pronchery		"Services" "Set daemons to run on startup" \
46a6d20207SPierre Pronchery		"System Hardening" "Set security options" \
47a6d20207SPierre Pronchery		"Time Zone" "Set system timezone" \
48*bbe2a1daSBjoern A. Zeeb		"Firmware" "Install Firmware (requires network)" \
49a6d20207SPierre Pronchery		"Handbook" "Install $OSNAME Handbook (requires network)" 2>&1 1>&5)
50a6d20207SPierre Pronchery	retval=$?
51a6d20207SPierre Pronchery	exec 5>&-
52a6d20207SPierre Pronchery
53ac78e3e9SPierre Pronchery	if [ $retval -ne $BSDDIALOG_OK ]; then
54ac78e3e9SPierre Pronchery		break
55ac78e3e9SPierre Pronchery	fi
56ac78e3e9SPierre Pronchery
57a6d20207SPierre Pronchery	case "$REVISIT" in
58a6d20207SPierre Pronchery	"Add User")
59a6d20207SPierre Pronchery		bsdinstall adduser
60a6d20207SPierre Pronchery		;;
61a6d20207SPierre Pronchery	"Root Password")
62a6d20207SPierre Pronchery		bsdinstall rootpass
63a6d20207SPierre Pronchery		;;
64a6d20207SPierre Pronchery	"Hostname")
65a6d20207SPierre Pronchery		bsdinstall hostname
66a6d20207SPierre Pronchery		;;
67a6d20207SPierre Pronchery	"Network")
68a6d20207SPierre Pronchery		bsdinstall netconfig
69a6d20207SPierre Pronchery		;;
70a6d20207SPierre Pronchery	"Services")
71a6d20207SPierre Pronchery		bsdinstall services
72a6d20207SPierre Pronchery		;;
73a6d20207SPierre Pronchery	"System Hardening")
74a6d20207SPierre Pronchery		bsdinstall hardening
75a6d20207SPierre Pronchery		;;
76a6d20207SPierre Pronchery	"Time Zone")
77a6d20207SPierre Pronchery		bsdinstall time
78a6d20207SPierre Pronchery		;;
79*bbe2a1daSBjoern A. Zeeb	"Firmware")
80*bbe2a1daSBjoern A. Zeeb		bsdinstall firmware
81*bbe2a1daSBjoern A. Zeeb		;;
82a6d20207SPierre Pronchery	"Handbook")
83a6d20207SPierre Pronchery		bsdinstall docsinstall
84a6d20207SPierre Pronchery		;;
85a6d20207SPierre Pronchery	esac
86a6d20207SPierre Proncherydone
87