Author: dteske Date: Thu Dec 8 19:28:12 2016 New Revision: 309720 URL: https://svnweb.freebsd.org/changeset/base/309720
Log: Functions in their own section Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 19:26:22 2016 (r309719) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 19:28:12 2016 (r309720) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2015 Devin Teske +# Copyright (c) 2013-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,31 +33,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_include $BSDCFG_SHARE/dialog.subr -############################################################ MAIN - -echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf -chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf - -echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf - -# Try to reach wpa_supplicant. If it isn't running and we can modify the -# existing system, start it. Otherwise, fail. -(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && - wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || - (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 - -# See if we succeeded -wpa_cli ping >/dev/null 2>/dev/null -if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Wireless cannot be configured without making changes to the local system!" \ 0 0 - exit 1 -fi +############################################################ FUNCTIONS country_set() { @@ -177,6 +153,32 @@ dialog_country_select() return $? } +############################################################ MAIN + +echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf +chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf + +echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf + +# Try to reach wpa_supplicant. If it isn't running and we can modify the +# existing system, start it. Otherwise, fail. +(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && + wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || + (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 + +# See if we succeeded +wpa_cli ping >/dev/null 2>/dev/null +if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then + dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + "Wireless cannot be configured without making changes to the local system!" \ 0 0 + exit 1 +fi + # There is no way to check country/regdomain without (possible) # interface state modification if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"