From owner-svn-src-head@freebsd.org Thu Dec 8 16:41:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D611DC6DF22; Thu, 8 Dec 2016 16:41:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BEB71E6A; Thu, 8 Dec 2016 16:41:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8GfIBx046801; Thu, 8 Dec 2016 16:41:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8GfI3t046800; Thu, 8 Dec 2016 16:41:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612081641.uB8GfI3t046800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 8 Dec 2016 16:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309716 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 16:41:19 -0000 Author: dteske Date: Thu Dec 8 16:41:18 2016 New Revision: 309716 URL: https://svnweb.freebsd.org/changeset/base/309716 Log: Add support for "hidden" Wi-Fi networks PR: bin/214933 Submitted by: Maxim Filimonov Reviewed by: dteske, allanjude, adrian MFC after: 6 days X-MFC-with: Follow-up commit for style Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 16:28:34 2016 (r309715) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 16:41:18 2016 (r309716) @@ -207,6 +207,7 @@ fi while : do + SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" dialog --backtitle "FreeBSD Installer" --title "Scanning" \ @@ -236,7 +237,19 @@ do break ;; 1) # Cancel - exit 1 + # here we ask if the user wants to select the network manually + f_dialog_title "Network Selection" + f_dialog_yesno "Do you want to select the network manually?" || exit 1 + # and take the manual input + # first, take the ssid + f_dialog_input NETWORK "Enter SSID" || exit 1 + # then, the encryption + ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \ + "$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \ + "1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1 + SCANSSID=1 + f_dialog_title_restore + break ;; 3) # Rescan ;; @@ -244,7 +257,7 @@ do exec 3>&- done -ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ +[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"` if echo $ENCRYPTION | grep -q 'PSK'; then @@ -258,6 +271,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID psk=\"$PASS\" priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf @@ -273,6 +287,7 @@ elif echo $ENCRYPTION | grep -q EAP; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf echo "$USERPASS" | awk ' { @@ -294,6 +309,7 @@ elif echo $ENCRYPTION | grep -q WEP; the || exec $0 $@ echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE wep_key0=\"$WEPKEY\" wep_tx_keyidx=0 @@ -302,6 +318,7 @@ echo "network={ else # Open echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf