xref: /freebsd/usr.sbin/bsdinstall/scripts/finalconfig (revision 97350075fe3a7951b7ef86a63c0a3f033dc03118)
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" \
39*97350075SJessica Clarke	    --no-cancel --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 \
41*97350075SJessica Clarke		"Finish" "Apply configuration and exit installer" \
42a6d20207SPierre Pronchery		"Add User" "Add a user to the system" \
43a6d20207SPierre Pronchery		"Root Password" "Change root password" \
44a6d20207SPierre Pronchery		"Hostname" "Set system hostname" \
45a6d20207SPierre Pronchery		"Network" "Networking configuration" \
46a6d20207SPierre Pronchery		"Services" "Set daemons to run on startup" \
47a6d20207SPierre Pronchery		"System Hardening" "Set security options" \
48a6d20207SPierre Pronchery		"Time Zone" "Set system timezone" \
49bbe2a1daSBjoern A. Zeeb		"Firmware" "Install Firmware (requires network)" \
50a6d20207SPierre Pronchery		"Handbook" "Install $OSNAME Handbook (requires network)" 2>&1 1>&5)
51a6d20207SPierre Pronchery	retval=$?
52a6d20207SPierre Pronchery	exec 5>&-
53a6d20207SPierre Pronchery
54ac78e3e9SPierre Pronchery	if [ $retval -ne $BSDDIALOG_OK ]; then
55ac78e3e9SPierre Pronchery		break
56ac78e3e9SPierre Pronchery	fi
57ac78e3e9SPierre Pronchery
58a6d20207SPierre Pronchery	case "$REVISIT" in
59*97350075SJessica Clarke	"Finish")
60*97350075SJessica Clarke		break
61*97350075SJessica Clarke		;;
62a6d20207SPierre Pronchery	"Add User")
63a6d20207SPierre Pronchery		bsdinstall adduser
64a6d20207SPierre Pronchery		;;
65a6d20207SPierre Pronchery	"Root Password")
66a6d20207SPierre Pronchery		bsdinstall rootpass
67a6d20207SPierre Pronchery		;;
68a6d20207SPierre Pronchery	"Hostname")
69a6d20207SPierre Pronchery		bsdinstall hostname
70a6d20207SPierre Pronchery		;;
71a6d20207SPierre Pronchery	"Network")
72a6d20207SPierre Pronchery		bsdinstall netconfig
73a6d20207SPierre Pronchery		;;
74a6d20207SPierre Pronchery	"Services")
75a6d20207SPierre Pronchery		bsdinstall services
76a6d20207SPierre Pronchery		;;
77a6d20207SPierre Pronchery	"System Hardening")
78a6d20207SPierre Pronchery		bsdinstall hardening
79a6d20207SPierre Pronchery		;;
80a6d20207SPierre Pronchery	"Time Zone")
81a6d20207SPierre Pronchery		bsdinstall time
82a6d20207SPierre Pronchery		;;
83bbe2a1daSBjoern A. Zeeb	"Firmware")
84bbe2a1daSBjoern A. Zeeb		bsdinstall firmware
85bbe2a1daSBjoern A. Zeeb		;;
86a6d20207SPierre Pronchery	"Handbook")
87a6d20207SPierre Pronchery		bsdinstall docsinstall
88a6d20207SPierre Pronchery		;;
89a6d20207SPierre Pronchery	esac
90a6d20207SPierre Proncherydone
91