summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgavin <gavin@FreeBSD.org>2014-01-04 17:09:41 +0000
committergavin <gavin@FreeBSD.org>2014-01-04 17:09:41 +0000
commit1abdd16f08d00d4680f543bf5cad444e510d88f1 (patch)
tree38765f62535265924e7ec284627cd66409c2c4e3
parentcde12fe3649e5cf7bfa96d89ade44a4240b684ea (diff)
downloadFreeBSD-src-1abdd16f08d00d4680f543bf5cad444e510d88f1.zip
FreeBSD-src-1abdd16f08d00d4680f543bf5cad444e510d88f1.tar.gz
Allow bsdinstall to use WPA-Enterprise networks when installing. This
only allows basic username/password config, and does not provide the ability to set any of the other WPA options. Regardless, this is generally sufficient to associate. Perhaps in the future this could allow full configuring (e.g. being able to set "anonymous identity", and perhaps some of the more obscure WPA options), though perhaps that will better belong in bsdconfig when that grows wlan config ability. MFC after: 1 week
-rwxr-xr-xusr.sbin/bsdinstall/scripts/wlanconfig23
1 files changed, 23 insertions, 0 deletions
diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
index 9c71bff..cefc2cb 100755
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -110,6 +110,29 @@ echo "network={
psk=\"$PASS\"
priority=5
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+elif echo $ENCRYPTION | grep -q EAP; then
+ exec 3>&1
+ USERPASS=`dialog --insecure --backtitle "FreeBSD 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
exec 3>&1
WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \
OpenPOWER on IntegriCloud