git: 7d0c12e1f907 - stable/14 - bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 21 Nov 2024 00:05:27 UTC
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d0c12e1f907ddf9be6668449a966703c0f781d1

commit 7d0c12e1f907ddf9be6668449a966703c0f781d1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-11-09 01:10:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-11-21 00:04:57 +0000

    bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant
    
    Make sure an interface is back up before (re-)starting wpa_supplicant
    in wlanconfig not relying on wpa to UP the interface (though we fixed
    that).
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    emaste (in D47491)
    Differential Revision: https://reviews.freebsd.org/D47491
    
    (cherry picked from commit 5399052c63a7a3d2f54615d31bfd092ab887a600)
---
 usr.sbin/bsdinstall/scripts/wlanconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
index 338e4f0a4109..728833f8d4a0 100755
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -55,7 +55,8 @@ country_set()
 		"$WLAN_IFACE" "$ifconfig_args"
 	error_str="${error_str#ifconfig: }"
 	# Restart wpa_supplicant(8) (should not fail).
-	[ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \
+	[ "$iface_up" ] && ifconfig "$WLAN_IFACE" up && \
+	    f_eval_catch -d wlanconfig wpa_supplicant \
 		'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
 		"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
 	if [ "$error_str" ]; then