rcdelete (251236) | rcdelete (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/rcdelete 251236 2013-06-01 23:58:44Z dteske $ | 27# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcdelete 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 --- 107 unchanged lines hidden (view full) --- 143# dialog_menu_main 144# 145# Display the dialog(1)-based application main menu. 146# 147dialog_menu_main() 148{ 149 local hline="$hline_arrows_tab_enter" 150 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 --- 107 unchanged lines hidden (view full) --- 143# dialog_menu_main 144# 145# Display the dialog(1)-based application main menu. 146# 147dialog_menu_main() 148{ 149 local hline="$hline_arrows_tab_enter" 150 local prompt="" |
151 local defaultitem= # Calculated below |
|
151 152 # 153 # [Re-]Accent the menu list before incorporating it 154 # 155 local rcconf_var details help menu_buf delete 156 eval set -- $RCCONF_MENU_LIST 157 while [ $# -gt 0 ]; do 158 rcconf_var="$1" details="$2" delete= --- 41 unchanged lines hidden (view full) --- 200 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ 201 height width rows \ 202 \"\$DIALOG_TITLE\" \ 203 \"\$DIALOG_BACKTITLE\" \ 204 \"\$prompt\" \ 205 \"\$hline\" \ 206 $menu_list 207 | 152 153 # 154 # [Re-]Accent the menu list before incorporating it 155 # 156 local rcconf_var details help menu_buf delete 157 eval set -- $RCCONF_MENU_LIST 158 while [ $# -gt 0 ]; do 159 rcconf_var="$1" details="$2" delete= --- 41 unchanged lines hidden (view full) --- 201 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ 202 height width rows \ 203 \"\$DIALOG_TITLE\" \ 204 \"\$DIALOG_BACKTITLE\" \ 205 \"\$prompt\" \ 206 \"\$hline\" \ 207 $menu_list 208 |
209 # Obtain default-item from previously stored selection 210 f_dialog_default_fetch defaultitem 211 |
|
208 local menu_choice 209 menu_choice=$( eval $DIALOG \ | 212 local menu_choice 213 menu_choice=$( eval $DIALOG \ |
210 --title \"\$DIALOG_TITLE\" \ 211 --backtitle \"\$DIALOG_BACKTITLE\" \ 212 --hline \"\$hline\" \ 213 --keep-tite \ 214 --ok-label \"\$msg_ok\" \ 215 --cancel-label \"\$msg_cancel\" \ 216 --help-button \ 217 --help-label \"\$msg_details\" \ 218 ${SHOW_DESC:+--item-help} \ 219 --default-item \"\$DEFAULTITEM_$$\" \ 220 --menu \"\$prompt\" \ 221 $height $width $rows \ 222 $menu_list \ | 214 --title \"\$DIALOG_TITLE\" \ 215 --backtitle \"\$DIALOG_BACKTITLE\" \ 216 --hline \"\$hline\" \ 217 --keep-tite \ 218 --ok-label \"\$msg_ok\" \ 219 --cancel-label \"\$msg_cancel\" \ 220 --help-button \ 221 --help-label \"\$msg_details\" \ 222 ${SHOW_DESC:+--item-help} \ 223 --default-item \"\$defaultitem\" \ 224 --menu \"\$prompt\" \ 225 $height $width $rows \ 226 $menu_list \ |
223 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 224 ) 225 local retval=$? 226 f_dialog_data_sanitize menu_choice 227 f_dialog_menutag_store "$menu_choice" 228 229 # Only update default-item on success | 227 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 228 ) 229 local retval=$? 230 f_dialog_data_sanitize menu_choice 231 f_dialog_menutag_store "$menu_choice" 232 233 # Only update default-item on success |
230 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice" | 234 [ $retval -eq 0 ] && f_dialog_default_store "$menu_choice" |
231 232 return $retval 233} 234 235# dialog_menu_confirm_delete $var1 [$var2 ...] 236# 237# Get the user's blessing to delete one or more variables. Returns success if 238# (and only-if) the user confirms (does not press ESC or Cancel/NO). Does NOT --- 171 unchanged lines hidden --- | 235 236 return $retval 237} 238 239# dialog_menu_confirm_delete $var1 [$var2 ...] 240# 241# Get the user's blessing to delete one or more variables. Returns success if 242# (and only-if) the user confirms (does not press ESC or Cancel/NO). Does NOT --- 171 unchanged lines hidden --- |