1251392Sandrew#!/bin/sh
2129202Scognet#-
3129202Scognet# Copyright (c) 2012-2013 Devin Teske
4129202Scognet# All rights reserved.
5129202Scognet#
6129202Scognet# Redistribution and use in source and binary forms, with or without
7129202Scognet# modification, are permitted provided that the following conditions
8129202Scognet# are met:
9129202Scognet# 1. Redistributions of source code must retain the above copyright
10129202Scognet#    notice, this list of conditions and the following disclaimer.
11129202Scognet# 2. Redistributions in binary form must reproduce the above copyright
12129202Scognet#    notice, this list of conditions and the following disclaimer in the
13129202Scognet#    documentation and/or other materials provided with the distribution.
14129202Scognet#
15129202Scognet# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16129202Scognet# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17129202Scognet# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18129202Scognet# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19129202Scognet# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20129202Scognet# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21129202Scognet# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22129202Scognet# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23129202Scognet# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24129202Scognet# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25129202Scognet# SUCH DAMAGE.
26129202Scognet#
27129202Scognet#
28129202Scognet############################################################ INCLUDES
29129202Scognet
30129202ScognetBSDCFG_SHARE="/usr/share/bsdconfig"
31129202Scognet. $BSDCFG_SHARE/common.subr || exit 1
32129202Scognetf_dprintf "%s: loading includes..." "$0"
33129202Scognetf_include $BSDCFG_SHARE/dialog.subr
34129202Scognetf_include $BSDCFG_SHARE/mustberoot.subr
35251392Sandrewf_include $BSDCFG_SHARE/startup/rcedit.subr
36251392Sandrew
37251392SandrewBSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup"
38251392Sandrewf_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
39251514Sandrew
40251514Sandrewf_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
41251514Sandrew	pgm="${ipgm:-$pgm}"
42251514Sandrew
43129202Scognet############################################################ MAIN
44251392Sandrew
45251392Sandrew# Incorporate rc-file if it exists
46129202Scognet[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
47251392Sandrew
48129202Scognet#
49129202Scognet# Process command-line arguments
50129202Scognet#
51129202Scognetwhile getopts h$GETOPTS_STDARGS flag; do
52129202Scognet	case "$flag" in
53129202Scognet	h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm" ;;
54129202Scognet	esac
55129202Scognetdone
56129202Scognetshift $(( $OPTIND - 1 ))
57129202Scognet
58129202Scognet#
59129202Scognet# Initialize
60129202Scognet#
61251392Sandrewf_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
62251392Sandrewf_mustberoot_init
63251392Sandrew
64135685Scognet#
65129202Scognet# Edit the rc.conf(5) variable(s) passed as argument(s)
66129202Scognet#
67129202Scognetf_dialog_rcedit "$@"
68251514Sandrew
69251514Sandrew################################################################################
70251514Sandrew# END
71251514Sandrew################################################################################
72251514Sandrew