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 251190 2013-05-31 19:07:17Z 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 dialog_menu
174 dialog_menu=$( 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 setvar DIALOG_MENU_$$ "$dialog_menu"
191
192 # Only update default-item on success
193 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu"
194
195 return $retval
196}
197
198############################################################ MAIN
199
200# Incorporate rc-file if it exists
201[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
--- 13 unchanged lines hidden (view full) ---
215#
216f_dialog_title "$msg_view_edit_startup_configuration"
217f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
218f_mustberoot_init
219
220while :; do
221 dialog_menu_main
222 retval=$?
223 mtag=$( f_dialog_menutag )
224
225 if [ "$USE_XDIALOG" ]; then
226 case "$mtag" in
227 "> $msg_view_details")
228 f_dialog_input_view_details
229 continue
230 esac
231 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 251190 2013-05-31 19:07:17Z 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 dialog_menu
174 dialog_menu=$( 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 setvar DIALOG_MENU_$$ "$dialog_menu"
191
192 # Only update default-item on success
193 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu"
194
195 return $retval
196}
197
198############################################################ MAIN
199
200# Incorporate rc-file if it exists
201[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
--- 13 unchanged lines hidden (view full) ---
215#
216f_dialog_title "$msg_view_edit_startup_configuration"
217f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
218f_mustberoot_init
219
220while :; do
221 dialog_menu_main
222 retval=$?
223 mtag=$( f_dialog_menutag )
224
225 if [ "$USE_XDIALOG" ]; then
226 case "$mtag" in
227 "> $msg_view_details")
228 f_dialog_input_view_details
229 continue
230 esac
231 elif [ $retval -eq 2 ]; then
--- 27 unchanged lines hidden ---