rcconf (251236) | rcconf (251244) |
---|---|
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# | 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 $ | 27# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcconf 251244 2013-06-02 09:02:12Z 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 --- 40 unchanged lines hidden (view full) --- 76# dialog_menu_main 77# 78# Display the dialog(1)-based application main menu. 79# 80dialog_menu_main() 81{ 82 local hline="$hline_arrows_tab_enter" 83 local prompt="" | 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 --- 40 unchanged lines hidden (view full) --- 76# dialog_menu_main 77# 78# Display the dialog(1)-based application main menu. 79# 80dialog_menu_main() 81{ 82 local hline="$hline_arrows_tab_enter" 83 local prompt="" |
84 local defaultitem= # Calculated below |
|
84 85 RCCONF_MENU_LIST=" 86 'X $msg_exit' '$msg_exit_desc' 87 ${SHOW_DESC:+'$msg_exit_help'} 88 '> $msg_add_new' '$msg_add_new_desc' 89 ${SHOW_DESC:+'$msg_add_new_help'} 90 '> $msg_delete' '$msg_delete_desc' 91 ${SHOW_DESC:+'$msg_delete_help'} --- 73 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 | 85 86 RCCONF_MENU_LIST=" 87 'X $msg_exit' '$msg_exit_desc' 88 ${SHOW_DESC:+'$msg_exit_help'} 89 '> $msg_add_new' '$msg_add_new_desc' 90 ${SHOW_DESC:+'$msg_add_new_help'} 91 '> $msg_delete' '$msg_delete_desc' 92 ${SHOW_DESC:+'$msg_delete_help'} --- 73 unchanged lines hidden (view full) --- 166 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ 167 height width rows \ 168 \"\$DIALOG_TITLE\" \ 169 \"\$DIALOG_BACKTITLE\" \ 170 \"\$prompt\" \ 171 \"\$hline\" \ 172 $RCCONF_MENU_LIST 173 |
174 # Obtain default-item from previously stored selection 175 f_dialog_default_fetch defaultitem 176 |
|
173 local menu_choice 174 menu_choice=$( eval $DIALOG \ | 177 local menu_choice 178 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 \ | 179 --title \"\$DIALOG_TITLE\" \ 180 --backtitle \"\$DIALOG_BACKTITLE\" \ 181 --hline \"\$hline\" \ 182 --ok-label \"\$msg_ok\" \ 183 --cancel-label \"\$msg_cancel\" \ 184 --help-button \ 185 --help-label \"\$msg_details\" \ 186 ${SHOW_DESC:+--item-help} \ 187 --default-item \"\$defaultitem\" \ 188 --menu \"\$prompt\" \ 189 $height $width $rows \ 190 $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 | 191 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 192 ) 193 local retval=$? 194 f_dialog_data_sanitize menu_choice 195 f_dialog_menutag_store "$menu_choice" 196 197 # Only update default-item on success |
194 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice" | 198 [ $retval -eq 0 ] && f_dialog_default_store "$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" --- 57 unchanged lines hidden --- | 199 200 return $retval 201} 202 203############################################################ MAIN 204 205# Incorporate rc-file if it exists 206[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" --- 57 unchanged lines hidden --- |