From owner-svn-src-all@freebsd.org Wed May 20 23:27:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FA212F7A5E; Wed, 20 May 2020 23:27:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S86G31lbz3ysL; Wed, 20 May 2020 23:27:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E45824108; Wed, 20 May 2020 23:27:02 +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 04KNR2Sr069354; Wed, 20 May 2020 23:27:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KNR2vO069353; Wed, 20 May 2020 23:27:02 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <202005202327.04KNR2vO069353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 May 2020 23:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361309 - stable/12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 23:27:02 -0000 Author: dteske Date: Wed May 20 23:27:01 2020 New Revision: 361309 URL: https://svnweb.freebsd.org/changeset/base/361309 Log: MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude Differential Revision: https://reviews.freebsd.org/D23641 Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 23:18:47 2020 (r361308) +++ stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 23:27:01 2020 (r361309) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <