From owner-svn-src-head@FreeBSD.ORG Tue Jun 18 09:43:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06A8D98D; Tue, 18 Jun 2013 09:43:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD8661BD3; Tue, 18 Jun 2013 09:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5I9hArT090831; Tue, 18 Jun 2013 09:43:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9hA8l090829; Tue, 18 Jun 2013 09:43:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306180943.r5I9hA8l090829@svn.freebsd.org> From: Devin Teske Date: Tue, 18 Jun 2013 09:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251928 - in head/usr.sbin/bsdconfig/networking: . include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:43:11 -0000 Author: dteske Date: Tue Jun 18 09:43:10 2013 New Revision: 251928 URL: http://svnweb.freebsd.org/changeset/base/251928 Log: Perform some code consolidation and add some additional error checking/reporting. (similar to SVN revision 251919) Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr head/usr.sbin/bsdconfig/networking/networking Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/messages.subr Tue Jun 18 09:42:43 2013 (r251927) +++ head/usr.sbin/bsdconfig/networking/include/messages.subr Tue Jun 18 09:43:10 2013 (r251928) @@ -99,6 +99,7 @@ msg_saving_network_interface="Saving %s msg_scanning_for_dhcp="Scanning for DHCP servers on %s interface..." msg_select_network_interface="Select a network interface to configure.\n\n* Interface is marked as \"active\"" msg_supported_media_options="Below is a list of supported media options for the %s interface. Please select the options that you would like to set for the %s network interface" +msg_unknown_networking_menu_selection="Unknown networking menu selection" xmsg_please_enter_fqhn="Please enter your fully qualified hostname (e.g. foo.bar.com).\n The domain portion of the hostname will be configured in resolv.conf(5)." xmsg_please_enter_nameserver_existing="Please enter the new IP address of the DNS nameserver\n(set to the NULL string to remove entry):" xmsg_supported_media_options="Below is a list of supported media options for the %s interface. Please\nselect the options that you would like to set for the %s network interface" Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Tue Jun 18 09:42:43 2013 (r251927) +++ head/usr.sbin/bsdconfig/networking/networking Tue Jun 18 09:43:10 2013 (r251928) @@ -119,35 +119,29 @@ while :; do dialog_menu_main || f_die f_dialog_menutag_fetch mtag + command= case "$mtag" in - X) # Exit - break - ;; - - 1) # Hostname/Domain - $BSDCFG_LIBE/$APP_DIR/hostname ${USE_XDIALOG:+-X} - ;; - - 2) # Network Interfaces - $BSDCFG_LIBE/$APP_DIR/devices ${USE_XDIALOG:+-X} - - # Make subsequent uses of this menu faster by not performing - # "ifconfig up" (limiting the pain one must endure). See also - # `$BSDCFG_SHARE/networking/device.subr'. - # - export DIALOG_MENU_NETDEV_KICK_INTERFACES= - ;; - - 3) # Default Router/Gateway - $BSDCFG_LIBE/$APP_DIR/defaultrouter ${USE_XDIALOG:+-X} - ;; - - 4) # DNS nameservers - $BSDCFG_LIBE/$APP_DIR/nameservers ${USE_XDIALOG:+-X} - ;; - + X) break ;; + 1) command=hostname ;; # Hostname/Domain + 2) command=devices ;; # Network Interfaces + 3) command=defaultrouter ;; # Default Router/Gateway + 4) command=nameservers ;; # DNS nameservers esac + if [ "$command" ]; then + $BSDCFG_LIBE/$APP_DIR/$command ${USE_XDIALOG:+-X} + else + f_die 1 "$msg_unknown_networking_menu_selection" + fi + + if [ "$mtag" = "devices" ]; then + # + # Make subsequent uses of this menu faster by not performing + # "ifconfig up" (limiting the pain one must endure). See also + # `$BSDCFG_SHARE/networking/device.subr'. + # + export DIALOG_MENU_NETDEV_KICK_INTERFACES= + fi done exit $SUCCESS