1#!/bin/sh
2#-
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcconf 251236 2013-06-01 23:58:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." "$0"
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/mustberoot.subr
--- 129 unchanged lines hidden (view full) ---
165 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \
166 height width rows \
167 \"\$DIALOG_TITLE\" \
168 \"\$DIALOG_BACKTITLE\" \
169 \"\$prompt\" \
170 \"\$hline\" \
171 $RCCONF_MENU_LIST
172
173 local menu_choice
174 menu_choice=$( eval $DIALOG \
175 --title \"\$DIALOG_TITLE\" \
176 --backtitle \"\$DIALOG_BACKTITLE\" \
177 --hline \"\$hline\" \
178 --ok-label \"\$msg_ok\" \
179 --cancel-label \"\$msg_cancel\" \
180 --help-button \
181 --help-label \"\$msg_details\" \
182 ${SHOW_DESC:+--item-help} \
183 --default-item \"\$DEFAULTITEM_$$\" \
184 --menu \"\$prompt\" \
185 $height $width $rows \
186 $RCCONF_MENU_LIST \
187 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
188 )
189 local retval=$?
190 f_dialog_data_sanitize menu_choice
191 f_dialog_menutag_store "$menu_choice"
192
193 # Only update default-item on success
194 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice"
195
196 return $retval
197}
198
199############################################################ MAIN
200
201# Incorporate rc-file if it exists
202[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
--- 13 unchanged lines hidden (view full) ---
216#
217f_dialog_title "$msg_view_edit_startup_configuration"
218f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
219f_mustberoot_init
220
221while :; do
222 dialog_menu_main
223 retval=$?
224 f_dialog_menutag_fetch mtag
225
226 if [ "$USE_XDIALOG" ]; then
227 case "$mtag" in
228 "> $msg_view_details")
229 f_dialog_input_view_details
230 continue
231 esac
232 elif [ $retval -eq 2 ]; then
--- 27 unchanged lines hidden ---
2#-
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcconf 251236 2013-06-01 23:58:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." "$0"
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/mustberoot.subr
--- 129 unchanged lines hidden (view full) ---
165 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \
166 height width rows \
167 \"\$DIALOG_TITLE\" \
168 \"\$DIALOG_BACKTITLE\" \
169 \"\$prompt\" \
170 \"\$hline\" \
171 $RCCONF_MENU_LIST
172
173 local menu_choice
174 menu_choice=$( eval $DIALOG \
175 --title \"\$DIALOG_TITLE\" \
176 --backtitle \"\$DIALOG_BACKTITLE\" \
177 --hline \"\$hline\" \
178 --ok-label \"\$msg_ok\" \
179 --cancel-label \"\$msg_cancel\" \
180 --help-button \
181 --help-label \"\$msg_details\" \
182 ${SHOW_DESC:+--item-help} \
183 --default-item \"\$DEFAULTITEM_$$\" \
184 --menu \"\$prompt\" \
185 $height $width $rows \
186 $RCCONF_MENU_LIST \
187 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
188 )
189 local retval=$?
190 f_dialog_data_sanitize menu_choice
191 f_dialog_menutag_store "$menu_choice"
192
193 # Only update default-item on success
194 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice"
195
196 return $retval
197}
198
199############################################################ MAIN
200
201# Incorporate rc-file if it exists
202[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
--- 13 unchanged lines hidden (view full) ---
216#
217f_dialog_title "$msg_view_edit_startup_configuration"
218f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
219f_mustberoot_init
220
221while :; do
222 dialog_menu_main
223 retval=$?
224 f_dialog_menutag_fetch mtag
225
226 if [ "$USE_XDIALOG" ]; then
227 case "$mtag" in
228 "> $msg_view_details")
229 f_dialog_input_view_details
230 continue
231 esac
232 elif [ $retval -eq 2 ]; then
--- 27 unchanged lines hidden ---