View | Details | Raw Unified | Return to bug 214933 | Differences between
and this patch

Collapse All | Expand All

(-)usr.sbin/bsdinstall/scripts/wlanconfig (-3 / +20 lines)
Lines 207-212 Link Here
207
207
208
while :
208
while :
209
do
209
do
210
	SCANSSID=0
210
	output=$( wpa_cli scan 2>&1 )
211
	output=$( wpa_cli scan 2>&1 )
211
	f_dprintf "%s" "$output"
212
	f_dprintf "%s" "$output"
212
	dialog --backtitle "FreeBSD Installer" --title "Scanning" \
213
	dialog --backtitle "FreeBSD Installer" --title "Scanning" \
Lines 236-243 Link Here
236
		break
237
		break
237
		;;
238
		;;
238
	1)	# Cancel
239
	1)	# Cancel
239
		exit 1
240
		# here we ask if the user wants to select the network manually
240
		;;
241
		f_dialog_yesno "Do you want to select the network manually?" || exit
242
		# and take the manual input
243
		# first, take the ssid
244
		f_dialog_title "Network Selection"
245
		f_dialog_input NETWORK "Enter SSID" || exit
246
		# then, the encryption
247
		ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \
248
			"$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \
249
			"1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 )
250
		[ $? -eq 0 ] || exit 1
251
		SCANSSID=1
252
		f_dialog_title_restore
253
		break
241
	3)	# Rescan
254
	3)	# Rescan
242
		;;
255
		;;
243
	esac
256
	esac
Lines 244-250 Link Here
244
	exec 3>&-
257
	exec 3>&-
245
done
258
done
246
259
247
ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \
260
[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \
248
    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"`
261
    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"`
249
262
250
if echo $ENCRYPTION | grep -q 'PSK'; then
263
if echo $ENCRYPTION | grep -q 'PSK'; then
Lines 258-263 Link Here
258
	exec 3>&-
271
	exec 3>&-
259
echo "network={
272
echo "network={
260
	ssid=\"$NETWORK\"
273
	ssid=\"$NETWORK\"
274
	scan_ssid=$SCANSSID
261
	psk=\"$PASS\"
275
	psk=\"$PASS\"
262
	priority=5
276
	priority=5
263
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
277
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
Lines 273-278 Link Here
273
	exec 3>&-
287
	exec 3>&-
274
echo "network={
288
echo "network={
275
	ssid=\"$NETWORK\"
289
	ssid=\"$NETWORK\"
290
	scan_ssid=$SCANSSID
276
	key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
291
	key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
277
echo "$USERPASS" | awk '
292
echo "$USERPASS" | awk '
278
{
293
{
Lines 294-299 Link Here
294
	|| exec $0 $@
309
	|| exec $0 $@
295
echo "network={
310
echo "network={
296
	ssid=\"$NETWORK\"
311
	ssid=\"$NETWORK\"
312
	scan_ssid=$SCANSSID
297
	key_mgmt=NONE
313
	key_mgmt=NONE
298
	wep_key0=\"$WEPKEY\"
314
	wep_key0=\"$WEPKEY\"
299
	wep_tx_keyidx=0
315
	wep_tx_keyidx=0
Lines 302-307 Link Here
302
else	# Open
318
else	# Open
303
echo "network={
319
echo "network={
304
	ssid=\"$NETWORK\"
320
	ssid=\"$NETWORK\"
321
	scan_ssid=$SCANSSID
305
	key_mgmt=NONE
322
	key_mgmt=NONE
306
	priority=5
323
	priority=5
307
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
324
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf

Return to bug 214933