diff options
author | dteske <dteske@FreeBSD.org> | 2017-01-08 16:55:59 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2017-01-08 16:55:59 +0000 |
commit | e1870c98e054e08f7faa6c68539f2e79efb9af3c (patch) | |
tree | 8d5bcd075ac20e3572503d056f3b67893b169ade /usr.sbin | |
parent | 38902a1ccc4c3301ac9d5ac36701c55e9fad5ac4 (diff) | |
download | FreeBSD-src-e1870c98e054e08f7faa6c68539f2e79efb9af3c.zip FreeBSD-src-e1870c98e054e08f7faa6c68539f2e79efb9af3c.tar.gz |
MFC r309716: Add support for "hidden" Wi-Fi networks
PR: bin/214933
Submitted by: Maxim Filimonov <che@bein.link>
Reviewed by: dteske, allanjude, adrian
Diffstat (limited to 'usr.sbin')
-rwxr-xr-x | usr.sbin/bsdinstall/scripts/wlanconfig | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig index c2af45a..3200418 100755 --- a/usr.sbin/bsdinstall/scripts/wlanconfig +++ b/usr.sbin/bsdinstall/scripts/wlanconfig @@ -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'; then 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; then 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; then || 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 |