1if [ ! "$_NETWORKING_RESOLV_SUBR" ]; then _NETWORKING_RESOLV_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/resolv.subr 251264 2013-06-02 20:02:50Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." networking/resolv.subr 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/strings.subr --- 351 unchanged lines hidden (view full) --- 387} 388 389# f_dialog_menu_nameservers 390# 391# Edit the nameservers in resolv.conf(5). 392# 393f_dialog_menu_nameservers() 394{ |
395 local prompt="$msg_dns_configuration" 396 local menu_list # Calculated below 397 local hline="$hline_arrows_tab_enter" 398 local defaultitem= |
399 400 local height width rows 401 local opt_exit="$msg_return_to_previous_menu" 402 local opt_add="$msg_add_nameserver" |
403 404 # 405 # Loop forever until the user has finished configuring nameservers 406 # |
407 while :; do 408 # 409 # Re/Build list of nameservers 410 # 411 local nameservers="$( f_resolv_conf_nameservers )" |
412 menu_list=$( |
413 index=1 414 415 echo "'X $msg_exit' '$opt_exit'" 416 index=$(( $index + 1 )) 417 418 echo "'A $msg_add' '$opt_add'" 419 index=$(( $index + 1 )) 420 421 for ns in $nameservers; do 422 [ $index -lt ${#DIALOG_MENU_TAGS} ] || break 423 tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) 424 echo "'$tag nameserver' '$ns'" 425 index=$(( $index + 1 )) 426 done |
427 ) |
428 429 # 430 # Display configuration-edit menu 431 # 432 eval f_dialog_menu_size height width rows \ 433 \"\$DIALOG_TITLE\" \ 434 \"\$DIALOG_BACKTITLE\" \ 435 \"\$prompt\" \ --- 46 unchanged lines hidden --- |