rcdelete (250633) | rcdelete (251190) |
---|---|
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 250633 2013-05-14 03:21:13Z dteske $ | 27# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcdelete 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 --- 105 unchanged lines hidden (view full) --- 141} 142 143# dialog_menu_main 144# 145# Display the dialog(1)-based application main menu. 146# 147dialog_menu_main() 148{ | 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 --- 105 unchanged lines hidden (view full) --- 141} 142 143# dialog_menu_main 144# 145# Display the dialog(1)-based application main menu. 146# 147dialog_menu_main() 148{ |
149 local size | |
150 local hline="$hline_arrows_tab_enter" 151 local prompt="" 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 --- 34 unchanged lines hidden (view full) --- 192 '> $msg_view_details' '$msg_view_details_desc' 193 ${SHOW_DESC:+'$msg_view_details_help'} 194 } 195 $menu_buf 196 " # END-QUOTE 197 198 set -f # noglob (descriptions in $RCCONF_MENU_LIST may contain *) 199 | 149 local hline="$hline_arrows_tab_enter" 150 local prompt="" 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 --- 34 unchanged lines hidden (view full) --- 191 '> $msg_view_details' '$msg_view_details_desc' 192 ${SHOW_DESC:+'$msg_view_details_help'} 193 } 194 $menu_buf 195 " # END-QUOTE 196 197 set -f # noglob (descriptions in $RCCONF_MENU_LIST may contain *) 198 |
200 size=$( eval f_dialog_menu_${SHOW_DESC:+with_help_}size \ 201 \"\$DIALOG_TITLE\" \ 202 \"\$DIALOG_BACKTITLE\" \ 203 \"\$prompt\" \ 204 \"\$hline\" \ 205 $menu_list ) | 199 local height width rows 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 |
206 207 local dialog_menu 208 dialog_menu=$( eval $DIALOG \ 209 --title \"\$DIALOG_TITLE\" \ 210 --backtitle \"\$DIALOG_BACKTITLE\" \ 211 --hline \"\$hline\" \ 212 --keep-tite \ 213 --ok-label \"\$msg_ok\" \ 214 --cancel-label \"\$msg_cancel\" \ 215 --help-button \ 216 --help-label \"\$msg_details\" \ 217 ${SHOW_DESC:+--item-help} \ 218 --default-item \"\$DEFAULTITEM_$$\" \ | 207 208 local dialog_menu 209 dialog_menu=$( 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_$$\" \ |
219 --menu \"\$prompt\" $size \ | 220 --menu \"\$prompt\" \ 221 $height $width $rows \ |
220 $menu_list \ 221 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 222 ) 223 local retval=$? 224 setvar DIALOG_MENU_$$ "$dialog_menu" 225 226 # Only update default-item on success 227 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" --- 4 unchanged lines hidden (view full) --- 232# dialog_menu_confirm_delete $var1 [$var2 ...] 233# 234# Get the user's blessing to delete one or more variables. Returns success if 235# (and only-if) the user confirms (does not press ESC or Cancel/NO). Does NOT 236# return the user's menu-choice. 237# 238dialog_menu_confirm_delete() 239{ | 222 $menu_list \ 223 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 224 ) 225 local retval=$? 226 setvar DIALOG_MENU_$$ "$dialog_menu" 227 228 # Only update default-item on success 229 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" --- 4 unchanged lines hidden (view full) --- 234# dialog_menu_confirm_delete $var1 [$var2 ...] 235# 236# Get the user's blessing to delete one or more variables. Returns success if 237# (and only-if) the user confirms (does not press ESC or Cancel/NO). Does NOT 238# return the user's menu-choice. 239# 240dialog_menu_confirm_delete() 241{ |
240 local size | |
241 local hline="$hline_arrows_tab_enter" 242 local prompt="$msg_are_you_sure_you_want_delete_the_following" 243 local var_list menu_list 244 245 [ $# -ge 1 ] || return $FAILURE 246 247 if [ $# -eq 1 ]; then 248 f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars" --- 15 unchanged lines hidden (view full) --- 264 prefix = cur_prefix 265 else 266 printf " " 267 var = $1 268 printf "%s'\'' '\'\''\n", var 269 }' 270 ) 271 | 242 local hline="$hline_arrows_tab_enter" 243 local prompt="$msg_are_you_sure_you_want_delete_the_following" 244 local var_list menu_list 245 246 [ $# -ge 1 ] || return $FAILURE 247 248 if [ $# -eq 1 ]; then 249 f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars" --- 15 unchanged lines hidden (view full) --- 265 prefix = cur_prefix 266 else 267 printf " " 268 var = $1 269 printf "%s'\'' '\'\''\n", var 270 }' 271 ) 272 |
272 size=$( eval f_dialog_menu_size \ 273 \"\$DIALOG_TITLE\" \ 274 \"\$DIALOG_BACKTITLE\" \ 275 \"\$prompt\" \ 276 \"\$hline\" \ 277 $menu_list ) | 273 local height width rows 274 eval f_dialog_menu_size height width rows \ 275 \"\$DIALOG_TITLE\" \ 276 \"\$DIALOG_BACKTITLE\" \ 277 \"\$prompt\" \ 278 \"\$hline\" \ 279 $menu_list |
278 279 local defaultno="defaultno" 280 [ "$USE_XDIALOG" ] && defaultno="default-no" 281 282 eval $DIALOG \ 283 --title \"\$DIALOG_TITLE\" \ 284 --backtitle \"\$DIALOG_BACKTITLE\" \ 285 --hline \"\$hline\" \ 286 --$defaultno \ 287 --ok-label \"\$msg_ok\" \ 288 --cancel-label \"\$msg_cancel\" \ | 280 281 local defaultno="defaultno" 282 [ "$USE_XDIALOG" ] && defaultno="default-no" 283 284 eval $DIALOG \ 285 --title \"\$DIALOG_TITLE\" \ 286 --backtitle \"\$DIALOG_BACKTITLE\" \ 287 --hline \"\$hline\" \ 288 --$defaultno \ 289 --ok-label \"\$msg_ok\" \ 290 --cancel-label \"\$msg_cancel\" \ |
289 --menu \"\$prompt\" $size \ | 291 --menu \"\$prompt\" \ 292 $height $width $rows \ |
290 $menu_list \ 291 2> /dev/null 292 293 # Menu choice ignored; status of above command returned 294} 295 296############################################################ MAIN 297 --- 108 unchanged lines hidden --- | 293 $menu_list \ 294 2> /dev/null 295 296 # Menu choice ignored; status of above command returned 297} 298 299############################################################ MAIN 300 --- 108 unchanged lines hidden --- |