rcedit revision 240684
1271294Sngie#!/bin/sh
2271294Sngie#-
3271294Sngie# Copyright (c) 2012 Devin Teske
4271294Sngie# All rights reserved.
5271294Sngie#
6271294Sngie# Redistribution and use in source and binary forms, with or without
7271294Sngie# modification, are permitted provided that the following conditions
8271294Sngie# are met:
9271294Sngie# 1. Redistributions of source code must retain the above copyright
10271294Sngie#    notice, this list of conditions and the following disclaimer.
11271294Sngie# 2. Redistributions in binary form must reproduce the above copyright
12271294Sngie#    notice, this list of conditions and the following disclaimer in the
13271294Sngie#    documentation and/or other materials provided with the distribution.
14271294Sngie#
15271294Sngie# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16271294Sngie# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17271294Sngie# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18271294Sngie# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19271294Sngie# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20271294Sngie# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21271294Sngie# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22271294Sngie# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23271294Sngie# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24271294Sngie# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25271294Sngie# SUCH DAMAGE.
26271294Sngie#
27271294Sngie# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcedit 240684 2012-09-18 22:28:42Z dteske $
28271294Sngie#
29271294Sngie############################################################ INCLUDES
30271294Sngie
31271294SngieBSDCFG_SHARE="/usr/share/bsdconfig"
32271294Sngie. $BSDCFG_SHARE/common.subr || exit 1
33271294Sngief_include $BSDCFG_SHARE/dialog.subr
34271294Sngief_include $BSDCFG_SHARE/mustberoot.subr
35271294Sngief_include $BSDCFG_SHARE/startup/rcedit.subr
36271294Sngie
37271294SngieBSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup"
38271294Sngief_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
39271294Sngie
40271294Sngieipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
41271294Sngie[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
42271294Sngie
43271294Sngie############################################################ MAIN
44271294Sngie
45271294Sngie# Incorporate rc-file if it exists
46271294Sngie[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
47271294Sngie
48271294Sngie#
49271294Sngie# Process command-line arguments
50271294Sngie#
51271294Sngiewhile getopts hSX flag; do
52271294Sngie	case "$flag" in
53271294Sngie	h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
54271294Sngie	esac
55271294Sngiedone
56271294Sngieshift $(( $OPTIND - 1 ))
57271294Sngie
58271294Sngie#
59271294Sngie# Initialize
60271294Sngie#
61271294Sngief_dialog_init
62271294Sngief_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
63271294Sngief_mustberoot_init
64271294Sngie
65271294Sngief_dialog_rcedit "$@"
66271294Sngie
67271294Sngie################################################################################
68271294Sngie# END
69271294Sngie################################################################################
70271294Sngie