netconfig (222611) | netconfig (222619) |
---|---|
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 222611 2011-06-02 14:08:50Z bz $ | 32# $FreeBSD: head/usr.sbin/bsdinstall/scripts/netconfig 222619 2011-06-02 14:25:27Z bz $ |
33 34INTERFACES="" 35DIALOG_TAGS="" 36 37: ${DIALOG_OK=0} 38: ${DIALOG_CANCEL=1} 39: ${DIALOG_HELP=2} 40: ${DIALOG_EXTRA=3} --- 8 unchanged lines hidden (view full) --- 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 | 33 34INTERFACES="" 35DIALOG_TAGS="" 36 37: ${DIALOG_OK=0} 38: ${DIALOG_CANCEL=1} 39: ${DIALOG_HELP=2} 40: ${DIALOG_EXTRA=3} --- 8 unchanged lines hidden (view full) --- 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 | 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 | 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 | 64 echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net |
65 IFCONFIG_PREFIX="WPA " 66 if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then 67 ifconfig $NEXT_WLAN_IFACE create wlandev $INTERFACE 68 ifconfig $NEXT_WLAN_IFACE up 69 fi 70 bsdinstall wlanconfig $NEXT_WLAN_IFACE || exec $0 71 INTERFACE="$NEXT_WLAN_IFACE" 72fi --- 17 unchanged lines hidden (view full) --- 90 exec $0 91 else 92 IPV4_AVAIL=0 93 fi 94fi 95# In case wlanconfig left an option and we do not support IPv4 we need to write 96# it out on its own. We cannot write it out with IPv6 as that suffix. 97if [ ${IPV4_AVAIL} -eq 0 -a -n ${IFCONFIG_PREFIX} ]; then | 65 IFCONFIG_PREFIX="WPA " 66 if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then 67 ifconfig $NEXT_WLAN_IFACE create wlandev $INTERFACE 68 ifconfig $NEXT_WLAN_IFACE up 69 fi 70 bsdinstall wlanconfig $NEXT_WLAN_IFACE || exec $0 71 INTERFACE="$NEXT_WLAN_IFACE" 72fi --- 17 unchanged lines hidden (view full) --- 90 exec $0 91 else 92 IPV4_AVAIL=0 93 fi 94fi 95# In case wlanconfig left an option and we do not support IPv4 we need to write 96# it out on its own. We cannot write it out with IPv6 as that suffix. 97if [ ${IPV4_AVAIL} -eq 0 -a -n ${IFCONFIG_PREFIX} ]; then |
98 echo ifconfig_${INTERFACE}=\"${IFCONFIG_PREFIX}\" >> $BSDINSTALL_TMPETC/rc.conf.net | 98 echo ifconfig_${INTERFACE}=\"${IFCONFIG_PREFIX}\" >> $BSDINSTALL_TMPETC/._rc.conf.net |
99fi 100if [ ${IPV6_AVAIL} -eq 1 ]; then 101 dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \ 102 --yesno 'Would you like to configure IPv6 for this interface?' 0 0 103 if [ $? -eq $DIALOG_OK ]; then 104 bsdinstall netconfig_ipv6 ${INTERFACE} || exec $0 105 else 106 IPV6_AVAIL=0 --- 80 unchanged lines hidden (view full) --- 187 } 188 if (search > 0) { 189 printf "%s%s", (search > 1) ? "," : "", $1; 190 next; 191 } 192 printf "nameserver %s\n", $1; 193}' > ${BSDINSTALL_TMPETC}/resolv.conf 194 | 99fi 100if [ ${IPV6_AVAIL} -eq 1 ]; then 101 dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \ 102 --yesno 'Would you like to configure IPv6 for this interface?' 0 0 103 if [ $? -eq $DIALOG_OK ]; then 104 bsdinstall netconfig_ipv6 ${INTERFACE} || exec $0 105 else 106 IPV6_AVAIL=0 --- 80 unchanged lines hidden (view full) --- 187 } 188 if (search > 0) { 189 printf "%s%s", (search > 1) ? "," : "", $1; 190 next; 191 } 192 printf "nameserver %s\n", $1; 193}' > ${BSDINSTALL_TMPETC}/resolv.conf 194 |
195mv $BSDINSTALL_TMPETC/._rc.conf.net $BSDINSTALL_TMPETC/rc.conf.net |
|