wlanconfig (260681) | wlanconfig (260682) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2011 Nathan Whitehorn 4# Copyright (c) 2013 Devin Teske 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26# SUCH DAMAGE. 27# | 1#!/bin/sh 2#- 3# Copyright (c) 2011 Nathan Whitehorn 4# Copyright (c) 2013 Devin Teske 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26# SUCH DAMAGE. 27# |
28# $FreeBSD: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig 260681 2014-01-15 08:12:19Z dteske $ | 28# $FreeBSD: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig 260682 2014-01-15 08:17:31Z dteske $ |
29# 30############################################################ INCLUDES 31 32BSDCFG_SHARE="/usr/share/bsdconfig" 33. $BSDCFG_SHARE/common.subr || exit 1 34 35############################################################ MAIN 36 --- 68 unchanged lines hidden (view full) --- 105 2>&1 1>&3` \ 106 || exec $0 $@ 107 exec 3>&- 108echo "network={ 109 ssid=\"$NETWORK\" 110 psk=\"$PASS\" 111 priority=5 112}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf | 29# 30############################################################ INCLUDES 31 32BSDCFG_SHARE="/usr/share/bsdconfig" 33. $BSDCFG_SHARE/common.subr || exit 1 34 35############################################################ MAIN 36 --- 68 unchanged lines hidden (view full) --- 105 2>&1 1>&3` \ 106 || exec $0 $@ 107 exec 3>&- 108echo "network={ 109 ssid=\"$NETWORK\" 110 psk=\"$PASS\" 111 priority=5 112}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf |
113elif echo $ENCRYPTION | grep -q EAP; then 114 exec 3>&1 115 USERPASS=`dialog --insecure --backtitle "FreeBSD Installer" \ 116 --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \ 117 "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ 118 "Username" 2 0 "" 2 12 25 63 0 \ 119 "Password" 3 0 "" 3 12 25 63 1 \ 120 2>&1 1>&3` \ 121 || exec $0 $@ 122 exec 3>&- 123echo "network={ 124 ssid=\"$NETWORK\" 125 key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf 126echo "$USERPASS" | awk ' 127{ 128 if (NR == 1) { 129 printf " identity=\"%s\"\n", $1; 130 } else if (NR == 2) { 131 printf " password=\"%s\"\n", $1; 132 } 133}' >> $BSDINSTALL_TMPETC/wpa_supplicant.conf 134echo " priority=5 135}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf |
|
113elif echo $ENCRYPTION | grep -q WEP; then 114 exec 3>&1 115 WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \ 116 --title "WEP Setup" --mixedform "" 0 0 0 \ 117 "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ 118 "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 119 2>&1 1>&3` \ 120 || exec $0 $@ --- 9 unchanged lines hidden (view full) --- 130 ssid=\"$NETWORK\" 131 key_mgmt=NONE 132 priority=5 133}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf 134fi 135 136# Connect to any open networks policy 137echo "network={ | 136elif echo $ENCRYPTION | grep -q WEP; then 137 exec 3>&1 138 WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \ 139 --title "WEP Setup" --mixedform "" 0 0 0 \ 140 "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \ 141 "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 142 2>&1 1>&3` \ 143 || exec $0 $@ --- 9 unchanged lines hidden (view full) --- 153 ssid=\"$NETWORK\" 154 key_mgmt=NONE 155 priority=5 156}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf 157fi 158 159# Connect to any open networks policy 160echo "network={ |
138 priority=5 | 161 priority=0 |
139 key_mgmt=NONE 140}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf 141 142# Bring up new network 143if [ "$BSDINSTALL_CONFIGCURRENT" ]; then 144 output=$( wpa_cli reconfigure 2>&1 ) 145 f_dprintf "%s" "$output" 146fi 147 148exit 0 149 150################################################################################ 151# END 152################################################################################ | 162 key_mgmt=NONE 163}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf 164 165# Bring up new network 166if [ "$BSDINSTALL_CONFIGCURRENT" ]; then 167 output=$( wpa_cli reconfigure 2>&1 ) 168 f_dprintf "%s" "$output" 169fi 170 171exit 0 172 173################################################################################ 174# END 175################################################################################ |