1218799Snwhitehorn#!/bin/sh 2218799Snwhitehorn#- 3218799Snwhitehorn# Copyright (c) 2011 Nathan Whitehorn 4218799Snwhitehorn# All rights reserved. 5218799Snwhitehorn# 6218799Snwhitehorn# Redistribution and use in source and binary forms, with or without 7218799Snwhitehorn# modification, are permitted provided that the following conditions 8218799Snwhitehorn# are met: 9218799Snwhitehorn# 1. Redistributions of source code must retain the above copyright 10218799Snwhitehorn# notice, this list of conditions and the following disclaimer. 11218799Snwhitehorn# 2. Redistributions in binary form must reproduce the above copyright 12218799Snwhitehorn# notice, this list of conditions and the following disclaimer in the 13218799Snwhitehorn# documentation and/or other materials provided with the distribution. 14218799Snwhitehorn# 15218799Snwhitehorn# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16218799Snwhitehorn# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17218799Snwhitehorn# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18218799Snwhitehorn# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19218799Snwhitehorn# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20218799Snwhitehorn# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21218799Snwhitehorn# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22218799Snwhitehorn# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23218799Snwhitehorn# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24218799Snwhitehorn# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25218799Snwhitehorn# SUCH DAMAGE. 26218799Snwhitehorn# 27218799Snwhitehorn# $FreeBSD: releng/10.3/usr.sbin/bsdinstall/scripts/services 273042 2014-10-13 15:53:01Z des $ 28218799Snwhitehorn 29228192Skensmith: ${DIALOG_OK=0} 30228192Skensmith 31218799Snwhitehornif [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then 32264472Sdteske eval $( sed -e s/YES/on/i -e s/NO/off/i \ 33264472Sdteske $BSDINSTALL_TMPETC/rc.conf.services ) 34218799Snwhitehornelse 35218799Snwhitehorn # Default service states. Everything is off if not enabled. 36218799Snwhitehorn sshd_enable="on" 37218799Snwhitehornfi 38218799Snwhitehorn 39218799Snwhitehornecho -n > $BSDINSTALL_TMPETC/rc.conf.services 40218799Snwhitehorn 41218799Snwhitehornexec 3>&1 42264472SdteskeDAEMONS=$( dialog --backtitle "FreeBSD Installer" \ 43218799Snwhitehorn --title "System Configuration" --nocancel --separate-output \ 44218799Snwhitehorn --checklist "Choose the services you would like to be started at boot:" \ 45218799Snwhitehorn 0 0 0 \ 46273042Sdes local_unbound "Local caching validating resolver" ${local_unbound:-off} \ 47218799Snwhitehorn sshd "Secure shell daemon" ${sshd_enable:-off} \ 48218799Snwhitehorn moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ 49218799Snwhitehorn ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ 50264472Sdteske powerd "Adjust CPU frequency dynamically if supported" \ 51264472Sdteske ${powerd_enable:-off} \ 52256361Sdteske dumpdev "Enable kernel crash dumps to /var/crash" ${dumpdev:-on} \ 53264472Sdteske2>&1 1>&3 ) 54218799Snwhitehornexec 3>&- 55218799Snwhitehorn 56259621Sdteskehavedump= 57218799Snwhitehornfor daemon in $DAEMONS; do 58264472Sdteske [ "$daemon" = "dumpdev" ] && havedump=1 continue 59218799Snwhitehorn echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services 60218799Snwhitehorndone 61218799Snwhitehorn 62264472Sdteskeecho '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ 63264472Sdteske 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services 64264472Sdteskeif [ "$havedump" ]; then 65264472Sdteske echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services 66264472Sdteskeelse 67228192Skensmith echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services 68228192Skensmithfi 69