1#!/bin/sh
2#-
3# Copyright (c) 2011 Nathan Whitehorn
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:
9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
--- 7 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, 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: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig 245980 2013-01-27 14:49:54Z nwhitehorn $
28
29echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf
30chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf
31
32echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
33echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
34echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
35echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
36echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
--- 8 unchanged lines hidden (view full) ---
45# See if we succeeded
46wpa_cli ping >/dev/null 2>/dev/null
47if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then
48 dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
49 "Wireless cannot be configured without making changes to the local system!" \ 0 0
50 exit 1
51fi
52
53wpa_cli scan >>$BSDINSTALL_LOG
54dialog --backtitle "FreeBSD Installer" --title "Scanning" --ok-label "Skip" \
55 --pause "Waiting 5 seconds to scan for wireless networks..." \
56 9 40 5 || exit 1
57
58SCAN_RESULTS=`wpa_cli scan_results`
59NETWORKS=`echo "$SCAN_RESULTS" | awk -F '\t' \
60 '/..:..:..:..:..:../ {if (length($5) > 0) printf("\"%s\"\t%s\n", $5, $4);}' |
61 sort | uniq`
--- 65 unchanged lines hidden (view full) ---
127
128# Connect to any open networks policy
129echo "network={
130 priority=5
131 key_mgmt=NONE
132}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
133
134# Bring up new network
135test ! -z $BSDINSTALL_CONFIGCURRENT && wpa_cli reconfigure >>$BSDINSTALL_LOG
136
137exit 0
2#-
3# Copyright (c) 2011 Nathan Whitehorn
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:
9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
--- 7 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, 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: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig 245980 2013-01-27 14:49:54Z nwhitehorn $
28
29echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf
30chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf
31
32echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
33echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
34echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
35echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
36echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
--- 8 unchanged lines hidden (view full) ---
45# See if we succeeded
46wpa_cli ping >/dev/null 2>/dev/null
47if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then
48 dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
49 "Wireless cannot be configured without making changes to the local system!" \ 0 0
50 exit 1
51fi
52
53wpa_cli scan >>$BSDINSTALL_LOG
54dialog --backtitle "FreeBSD Installer" --title "Scanning" --ok-label "Skip" \
55 --pause "Waiting 5 seconds to scan for wireless networks..." \
56 9 40 5 || exit 1
57
58SCAN_RESULTS=`wpa_cli scan_results`
59NETWORKS=`echo "$SCAN_RESULTS" | awk -F '\t' \
60 '/..:..:..:..:..:../ {if (length($5) > 0) printf("\"%s\"\t%s\n", $5, $4);}' |
61 sort | uniq`
--- 65 unchanged lines hidden (view full) ---
127
128# Connect to any open networks policy
129echo "network={
130 priority=5
131 key_mgmt=NONE
132}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
133
134# Bring up new network
135test ! -z $BSDINSTALL_CONFIGCURRENT && wpa_cli reconfigure >>$BSDINSTALL_LOG
136
137exit 0