1if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then _NETWORKING_MEDIA_SUBR=1 2# 3# Copyright (c) 2006-2012 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/networking/share/media.subr 240768 2012-09-20 23:44:13Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_include $BSDCFG_SHARE/dialog.subr 34f_include $BSDCFG_SHARE/strings.subr 35f_include $BSDCFG_SHARE/sysrc.subr --- 82 unchanged lines hidden (view full) --- 118 "$setting" )" 119 f_dialog_msgbox "$message" 120 return $FAILURE 121 fi 122 123 local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )" 124 local hline="$hline_alnum_punc_tab_enter" 125 |
126 local dialog_inputbox 127 dialog_inputbox=$( $DIALOG \ |
128 --title "$DIALOG_TITLE" \ 129 --backtitle "$DIALOG_BACKTITLE" \ 130 --hline "$hline" \ 131 --ok-label "$msg_ok" \ 132 --cancel-label "$msg_cancel" \ 133 --inputbox "$msg" 9 70 \ 134 "$options" \ |
135 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 136 ) |
137 138 local retval=$? |
139 setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" |
140 local _options="$( f_dialog_inputstr )" 141 142 [ $retval -eq $SUCCESS ] && options="$_options" 143 144 return $retval 145} 146 147# f_dialog_menu_media_options $interface --- 55 unchanged lines hidden (view full) --- 203 "$interface" "$interface" ) 204 else 205 msg=$( printf "$msg_supported_media_options" \ 206 "$interface" "$interface" ) 207 fi 208 209 local hline="$hline_arrows_tab_enter" 210 |
211 local dialog_menu 212 dialog_menu=$( eval $DIALOG \ |
213 --clear --title \"\$DIALOG_TITLE\" \ 214 --backtitle \"\$DIALOG_BACKTITLE\" \ 215 --hline \"\$hline\" \ 216 --ok-label \"\$msg_ok\" \ 217 --cancel-label \"\$msg_cancel\" \ 218 --menu \"\$msg\" 21 60 12 \ 219 $supported_media \ |
220 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 221 ) |
222 223 local retval=$? |
224 setvar DIALOG_MENU_$$ "$dialog_menu" |
225 if [ $retval -eq $SUCCESS ]; then 226 local tag="$( f_dialog_menutag )" 227 options=$( eval f_dialog_menutag2item \"\$tag\" \ 228 $supported_media ) 229 [ "$options" = "$opt_none" ] && options= 230 231 if [ "$options" = "$opt_cust" ]; then 232 options="$_options" 233 f_dialog_input_options "$interface" 234 retval=$? 235 fi 236 fi 237 238 return $retval 239} 240 241fi # ! $_NETWORKING_MEDIA_SUBR |