1if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1 2# 3# Copyright (c) 2006-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/networking/share/device.subr 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..." networking/device.subr 34f_include $BSDCFG_SHARE/device.subr 35f_include $BSDCFG_SHARE/dialog.subr --- 101 unchanged lines hidden (view full) --- 137 defaultitem="$defaultitem*" 138 fi 139 140 local hline="$hline_arrows_tab_enter" 141 142 # 143 # Ask user to select an interface 144 # |
145 local prompt |
146 prompt="$msg_select_network_interface" |
147 local height width rows 148 eval f_dialog_menu_size height width rows \ 149 \"\$DIALOG_TITLE\" \ 150 \"\$DIALOG_BACKTITLE\" \ 151 \"\$prompt\" \ 152 \"\$hline\" \ 153 $interfaces |
154 local dialog_menu 155 dialog_menu=$( eval $DIALOG \ 156 --title \"\$DIALOG_TITLE\" \ 157 --backtitle \"\$DIALOG_BACKTITLE\" \ 158 --hline \"\$hline\" \ 159 --ok-label \"\$msg_ok\" \ 160 --cancel-label \"\$msg_cancel\" \ 161 --default-item \"\$defaultitem\" \ |
162 --menu \"\$prompt\" \ 163 $height $width $rows \ |
164 $interfaces \ 165 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 166 ) 167 local retval=$? 168 setvar DIALOG_MENU_$$ "$dialog_menu" 169 return $retval 170} 171 172# f_dialog_menu_netdev_edit $interface $ipaddr $netmask $options $dhcp 173# 174# Allow a user to edit network interface settings. Current values are not 175# probed but rather taken from the positional arguments. 176# 177f_dialog_menu_netdev_edit() 178{ 179 local interface="$1" ipaddr="$2" netmask="$3" options="$4" dhcp="$5" |
180 local prompt menu_list height width rows |
181 182 # 183 # Create a duplicate set of variables for change-tracking... 184 # 185 local ipaddr_orig="$2" \ 186 netmask_orig="$3" \ 187 options_orig="$4" \ 188 dhcp_orig="$5" --- 24 unchanged lines hidden (view full) --- 213 # 214 menu_list=" 215 'X $msg_save_exit' '$msg_return_to_previous_menu' 216 '2 $msg_dhcp' '$dhcp_status' 217 '3 $msg_ipaddr4' '$ipaddr' 218 '4 $msg_netmask' '$netmask' 219 '5 $msg_options' '$options' 220 " |
221 eval f_dialog_menu_size height width rows \ 222 \"\$DIALOG_TITLE\" \ 223 \"\$DIALOG_BACKTITLE\" \ 224 \"\$prompt\" \ 225 \"\$hline\" \ 226 $menu_list |
227 local dialog_menu 228 dialog_menu=$( eval $DIALOG \ 229 --title \"\$DIALOG_TITLE\" \ 230 --backtitle \"\$DIALOG_BACKTITLE\" \ 231 --hline \"\$hline\" \ 232 --ok-label \"\$msg_ok\" \ 233 --cancel-label \"\$msg_cancel\" \ 234 --help-button \ 235 --help-label \"\$msg_help\" \ 236 ${USE_XDIALOG:+--help \"\"} \ 237 --default-item \"\$defaultitem\" \ |
238 --menu \"\$prompt\" \ 239 $height $width $rows \ |
240 $menu_list \ 241 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 242 ) 243 244 local retval=$? 245 setvar DIALOG_MENU_$$ "$dialog_menu" 246 local tag="$( f_dialog_menutag )" 247 --- 150 unchanged lines hidden --- |