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