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

Collapse All | Expand All

(-)usr.sbin/bsdinstall/scripts/wlanconfig (-2 / +25 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-242 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
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
		f_dialog_title_restore
247
		# then, the encryption
248
		ENCRYPTION=$(dialog --backtitle "FreeBSD Installer" --title \
249
			"Network Selection" --menu "Select encryption type" 0 0 0 \
250
			"WPA/WPA2 PSK" "" "WPA/WPA2 EAP" "" "WEP" "" \
251
			"None" "" 2>&1 1>&3)
252
		[ $? -eq 0 ] || exit 1
253
		SCANSSID=1
254
		break
255
		1) # No
256
			exit 1
257
			;;
258
		esac
240
		;;
259
		;;
241
	3)	# Rescan
260
	3)	# Rescan
242
		;;
261
		;;
Lines 244-250 Link Here
244
	exec 3>&-
263
	exec 3>&-
245
done
264
done
246
265
247
ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \
266
[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \
248
    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"`
267
    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"`
249
268
250
if echo $ENCRYPTION | grep -q 'PSK'; then
269
if echo $ENCRYPTION | grep -q 'PSK'; then
Lines 258-263 Link Here
258
	exec 3>&-
277
	exec 3>&-
259
echo "network={
278
echo "network={
260
	ssid=\"$NETWORK\"
279
	ssid=\"$NETWORK\"
280
	scan_ssid=$SCANSSID
261
	psk=\"$PASS\"
281
	psk=\"$PASS\"
262
	priority=5
282
	priority=5
263
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
283
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
Lines 273-278 Link Here
273
	exec 3>&-
293
	exec 3>&-
274
echo "network={
294
echo "network={
275
	ssid=\"$NETWORK\"
295
	ssid=\"$NETWORK\"
296
	scan_ssid=$SCANSSID
276
	key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
297
	key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
277
echo "$USERPASS" | awk '
298
echo "$USERPASS" | awk '
278
{
299
{
Lines 294-299 Link Here
294
	|| exec $0 $@
315
	|| exec $0 $@
295
echo "network={
316
echo "network={
296
	ssid=\"$NETWORK\"
317
	ssid=\"$NETWORK\"
318
	scan_ssid=$SCANSSID
297
	key_mgmt=NONE
319
	key_mgmt=NONE
298
	wep_key0=\"$WEPKEY\"
320
	wep_key0=\"$WEPKEY\"
299
	wep_tx_keyidx=0
321
	wep_tx_keyidx=0
Lines 302-307 Link Here
302
else	# Open
324
else	# Open
303
echo "network={
325
echo "network={
304
	ssid=\"$NETWORK\"
326
	ssid=\"$NETWORK\"
327
	scan_ssid=$SCANSSID
305
	key_mgmt=NONE
328
	key_mgmt=NONE
306
	priority=5
329
	priority=5
307
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
330
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf

Return to bug 214933