netconfig (222468) | netconfig (222611) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2011 Nathan Whitehorn 4# All rights reserved. 5# Copyright (c) 2011 The FreeBSD Foundation 6# All rights reserved. 7# 8# Portions of this software were developed by Bjoern Zeeb --- 15 unchanged lines hidden (view full) --- 24# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30# SUCH DAMAGE. 31# | 1#!/bin/sh 2#- 3# Copyright (c) 2011 Nathan Whitehorn 4# All rights reserved. 5# Copyright (c) 2011 The FreeBSD Foundation 6# All rights reserved. 7# 8# Portions of this software were developed by Bjoern Zeeb --- 15 unchanged lines hidden (view full) --- 24# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30# SUCH DAMAGE. 31# |
32# $FreeBSD: head/usr.sbin/bsdinstall/scripts/netconfig 222468 2011-05-29 21:24:20Z bz $ | 32# $FreeBSD: head/usr.sbin/bsdinstall/scripts/netconfig 222611 2011-06-02 14:08:50Z bz $ |
33 34INTERFACES="" 35DIALOG_TAGS="" 36 37: ${DIALOG_OK=0} 38: ${DIALOG_CANCEL=1} 39: ${DIALOG_HELP=2} 40: ${DIALOG_EXTRA=3} 41: ${DIALOG_ITEM_HELP=4} 42: ${DIALOG_ESC=255} 43 | 33 34INTERFACES="" 35DIALOG_TAGS="" 36 37: ${DIALOG_OK=0} 38: ${DIALOG_CANCEL=1} 39: ${DIALOG_HELP=2} 40: ${DIALOG_EXTRA=3} 41: ${DIALOG_ITEM_HELP=4} 42: ${DIALOG_ESC=255} 43 |
44echo -n > $BSDINSTALL_TMPETC/rc.conf.net 45 | |
46for IF in `ifconfig -l`; do 47 test "$IF" = "lo0" && continue 48 (ifconfig -g wlan | egrep -wq $IF) && continue 49 INTERFACES="$INTERFACES $IF" 50 DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc` 51 DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\"" 52done 53 54exec 3>&1 55INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3` 56if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi 57exec 3>&- 58 | 44for IF in `ifconfig -l`; do 45 test "$IF" = "lo0" && continue 46 (ifconfig -g wlan | egrep -wq $IF) && continue 47 INTERFACES="$INTERFACES $IF" 48 DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc` 49 DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\"" 50done 51 52exec 3>&1 53INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3` 54if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi 55exec 3>&- 56 |
57: > $BSDINSTALL_TMPETC/rc.conf.net 58 |
|
59# Do a dirty check to see if this a wireless interface -- there should be a 60# better way 61IFCONFIG_PREFIX="" 62if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then 63 NEXT_WLAN_IFACE=wlan0 # XXX 64 echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/rc.conf.net 65 IFCONFIG_PREFIX="WPA " 66 if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then --- 128 unchanged lines hidden --- | 59# Do a dirty check to see if this a wireless interface -- there should be a 60# better way 61IFCONFIG_PREFIX="" 62if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then 63 NEXT_WLAN_IFACE=wlan0 # XXX 64 echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/rc.conf.net 65 IFCONFIG_PREFIX="WPA " 66 if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then --- 128 unchanged lines hidden --- |