[Midnightbsd-cvs] src [11305] trunk/usr.sbin/bsdinstall/scripts/wlanconfig: update wlan config
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Jul 4 10:04:47 EDT 2018
Revision: 11305
http://svnweb.midnightbsd.org/src/?rev=11305
Author: laffer1
Date: 2018-07-04 10:04:47 -0400 (Wed, 04 Jul 2018)
Log Message:
-----------
update wlan config
Modified Paths:
--------------
trunk/usr.sbin/bsdinstall/scripts/wlanconfig
Property Changed:
----------------
trunk/usr.sbin/bsdinstall/scripts/wlanconfig
Modified: trunk/usr.sbin/bsdinstall/scripts/wlanconfig
===================================================================
--- trunk/usr.sbin/bsdinstall/scripts/wlanconfig 2018-07-04 14:03:25 UTC (rev 11304)
+++ trunk/usr.sbin/bsdinstall/scripts/wlanconfig 2018-07-04 14:04:47 UTC (rev 11305)
@@ -1,6 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -24,9 +25,16 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
+# $FreeBSD: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig 290288 2015-11-02 22:05:04Z dteske $
# $MidnightBSD$
-# $FreeBSD: src/usr.sbin/bsdinstall/scripts/wlanconfig,v 1.3 2011/09/13 21:39:26 brueffer Exp $
+#
+############################################################ INCLUDES
+BSDCFG_SHARE="/usr/share/bsdconfig"
+. $BSDCFG_SHARE/common.subr || exit 1
+
+############################################################ MAIN
+
echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf
chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf
@@ -51,7 +59,8 @@
exit 1
fi
-wpa_cli scan >>$BSDINSTALL_LOG
+output=$( wpa_cli scan 2>&1 )
+f_dprintf "%s" "$output"
dialog --backtitle "MidnightBSD Installer" --title "Scanning" --ok-label "Skip" \
--pause "Waiting 5 seconds to scan for wireless networks..." \
9 40 5 || exit 1
@@ -102,8 +111,30 @@
psk=\"$PASS\"
priority=5
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+elif echo $ENCRYPTION | grep -q EAP; then
+ exec 3>&1
+ USERPASS=`dialog --insecure --backtitle "MidnightBSD Installer" \
+ --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \
+ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
+ "Username" 2 0 "" 2 12 25 63 0 \
+ "Password" 3 0 "" 3 12 25 63 1 \
+ 2>&1 1>&3` \
+ || exec $0 $@
+ exec 3>&-
+echo "network={
+ ssid=\"$NETWORK\"
+ key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+echo "$USERPASS" | awk '
+{
+ if (NR == 1) {
+ printf " identity=\"%s\"\n", $1;
+ } else if (NR == 2) {
+ printf " password=\"%s\"\n", $1;
+ }
+}' >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+echo " priority=5
+}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
elif echo $ENCRYPTION | grep -q WEP; then
- echo FOO
exec 3>&1
WEPKEY=`dialog --insecure --backtitle "MidnightBSD Installer" \
--title "WEP Setup" --mixedform "" 0 0 0 \
@@ -128,11 +159,18 @@
# Connect to any open networks policy
echo "network={
- priority=5
+ priority=0
key_mgmt=NONE
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
# Bring up new network
-test ! -z $BSDINSTALL_CONFIGCURRENT && wpa_cli reconfigure >>$BSDINSTALL_LOG
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
+ output=$( wpa_cli reconfigure 2>&1 )
+ f_dprintf "%s" "$output"
+fi
-exit 0
+exit $SUCCESS
+
+################################################################################
+# END
+################################################################################
Property changes on: trunk/usr.sbin/bsdinstall/scripts/wlanconfig
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list